|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.security.integration.password.XMLEncryptionUtil
public class XMLEncryptionUtil
XML Encryption Util Note: This utility is currently using Apache XML Security library API. JSR-106 is not yet final. Until that happens,we rely on the non-standard API.
Field Summary | |
---|---|
static String |
CIPHER_DATA_LOCALNAME
|
static String |
DS_KEY_INFO
|
static String |
ENCRYPTED_DATA_LOCALNAME
|
static String |
ENCRYPTED_KEY_LOCALNAME
|
static String |
XMLENC_NS
|
static String |
XMLNS
|
static String |
XMLSIG_NS
|
Constructor Summary | |
---|---|
XMLEncryptionUtil()
|
Method Summary | |
---|---|
static Document |
decrypt(Document encryptedDoc,
PrivateKey privateKey)
Decrypt a document |
static Document |
encrypt(Document document,
SecretKey secretKey,
PublicKey publicKey,
int keySize)
Encrypt a document at the root (Use aes-128) |
static org.apache.xml.security.encryption.EncryptedKey |
encryptKey(Document document,
SecretKey keyToBeEncrypted,
PublicKey keyUsedToEncryptSecretKey,
int keySize)
Encrypt the Key to be transported |
static String |
getXMLEncryptionURL(String algo,
int keySize)
From the secret key, get the W3C XML Encryption URL |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String CIPHER_DATA_LOCALNAME
public static final String ENCRYPTED_DATA_LOCALNAME
public static final String ENCRYPTED_KEY_LOCALNAME
public static final String DS_KEY_INFO
public static final String XMLNS
public static String XMLSIG_NS
public static String XMLENC_NS
Constructor Detail |
---|
public XMLEncryptionUtil()
Method Detail |
---|
public static org.apache.xml.security.encryption.EncryptedKey encryptKey(Document document, SecretKey keyToBeEncrypted, PublicKey keyUsedToEncryptSecretKey, int keySize) throws Exception
Encrypt the Key to be transported
Data is encrypted with a SecretKey. Then the key needs to be transported to the other end where it is needed for decryption. For the Key transport, the SecretKey is encrypted with the recipient's public key. At the receiving end, the receiver can decrypt the Secret Key using his private key.s
document
- keyToBeEncrypted
- Symmetric Key (SecretKey)keyUsedToEncryptSecretKey
- Asymmetric Key (Public Key)keySize
- Length of the key
Exception
public static Document encrypt(Document document, SecretKey secretKey, PublicKey publicKey, int keySize) throws Exception
document
- secretKey
- publicKey
- keySize
-
Exception
public static Document decrypt(Document encryptedDoc, PrivateKey privateKey) throws Exception
encryptedDoc
- privateKey
-
Exception
public static String getXMLEncryptionURL(String algo, int keySize)
secretKey
- keySize
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |