|
XML Security, 1.6 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ibm.xml.enc.dom.DOMStructure
com.ibm.xml.enc.dom.DOMEncryptionMethod
com.ibm.xml.enc.dom.DOMRSA15
public final class DOMRSA15
DOM-based implementation of EncryptionMethod for RSA algorithm.
| Field Summary |
|---|
| Fields inherited from interface javax.xml.crypto.enc.EncryptionMethod |
|---|
AES128_CBC, AES192_CBC, AES256_CBC, KW_AES128, KW_AES192, KW_AES256, KW_TRIPLEDES, RSA_1_5, RSA_OAEP_MGF1P, TRIPLEDES_CBC |
| Constructor Summary | |
|---|---|
DOMRSA15(org.w3c.dom.Element smElem)
Creates a DOMRSA15 from an element. |
|
DOMRSA15(java.lang.Integer keySize,
java.security.spec.AlgorithmParameterSpec params)
Creates a DOMRSA15 for the specified
input parameters. |
|
| Method Summary | |
|---|---|
protected void |
checkParams(java.lang.Integer keySize,
EncryptionMethodParameterSpec params)
Checks if the specified parameters are valid for this algorithm. |
byte[] |
decrypt(java.security.Key key,
byte[] data)
decrypt the specified bytes with the specified key, using the underlying encryption algorithm. |
java.security.Key |
decryptKey(java.security.Key key,
byte[] encrypted,
AlgorithmMethod algo)
|
byte[] |
encrypt(java.security.Key key,
byte[] data,
EncryptedType type)
encrypt the passed-in data with the specified key, using the underlying encryption algorithm and parameters. |
java.lang.String |
getAlgorithmConstant()
|
protected void |
marshalParams(org.w3c.dom.Element parent,
java.lang.String dsPrefix)
Marshals the algorithm-specific parameters to an Element and appends it to the specified parent element. |
protected boolean |
paramsEqual(java.security.spec.AlgorithmParameterSpec spec)
Returns true if parameters are equal; false otherwise. |
protected EncryptionMethodParameterSpec |
unmarshalParams(org.w3c.dom.Element paramsElem)
Unmarshals EncryptionMethodParameterSpec from the specified
Element. |
byte[] |
unwrap(java.security.Key key,
byte[] encrypted)
unwraps a previously wrapped key using the underlying encryption algorithm. |
java.security.Key |
unwrap(java.security.Key key,
byte[] encrypted,
AlgorithmMethod algo)
unwraps a previously wrapped key using the underlying encryption algorithm. |
byte[] |
wrap(java.security.Key key,
java.security.Key toBeWrapped)
encrypt the passed-in key with the specified key, using the underlying encryption algorithm and parameters. |
| Methods inherited from class com.ibm.xml.enc.dom.DOMEncryptionMethod |
|---|
equals, genKey, getAlgorithm, getKeySize, getParameterSpec, init, marshal, parseAlg, unmarshal |
| Methods inherited from class com.ibm.xml.enc.dom.DOMStructure |
|---|
isFeatureSupported |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.xml.crypto.XMLStructure |
|---|
isFeatureSupported |
| Constructor Detail |
|---|
public DOMRSA15(java.lang.Integer keySize,
java.security.spec.AlgorithmParameterSpec params)
throws java.security.InvalidAlgorithmParameterException
DOMRSA15 for the specified
input parameters.
params - algorithm-specific parameters (may be null)
java.security.InvalidAlgorithmParameterException - if the parameters are not
appropriate for this cipher method
public DOMRSA15(org.w3c.dom.Element smElem)
throws MarshalException
DOMRSA15 from an element.
smElem - a EncryptionMethod element
MarshalException| Method Detail |
|---|
public java.lang.String getAlgorithmConstant()
protected void checkParams(java.lang.Integer keySize,
EncryptionMethodParameterSpec params)
throws java.security.InvalidAlgorithmParameterException
DOMEncryptionMethod
checkParams in class DOMEncryptionMethodparams - the algorithm-specific params (may be null)
java.security.InvalidAlgorithmParameterException - if the parameters are not
appropriate for this encryption method
protected EncryptionMethodParameterSpec unmarshalParams(org.w3c.dom.Element paramsElem)
throws MarshalException
DOMEncryptionMethodEncryptionMethodParameterSpec from the specified
Element. Subclasses should implement this to unmarshal
the algorithm-specific parameters.
unmarshalParams in class DOMEncryptionMethodparamsElem - the Element holding the input params
EncryptionMethodParameterSpec
MarshalException - if the parameters cannot be unmarshalled
protected void marshalParams(org.w3c.dom.Element parent,
java.lang.String dsPrefix)
throws MarshalException
DOMEncryptionMethod
marshalParams in class DOMEncryptionMethodparent - the parent element to append the parameters todsPrefix - the algorithm parameters prefix to use
MarshalException - if the parameters cannot be marshalledprotected boolean paramsEqual(java.security.spec.AlgorithmParameterSpec spec)
DOMEncryptionMethod
paramsEqual in class DOMEncryptionMethod
public byte[] decrypt(java.security.Key key,
byte[] data)
throws java.security.InvalidKeyException,
javax.crypto.BadPaddingException,
javax.crypto.IllegalBlockSizeException
DOMEncryptionMethod
decrypt in class DOMEncryptionMethodkey - the decryption keydata - the bytes to be decrypted
java.security.InvalidKeyException - if the key is improperly encoded, of
the wrong type, or parameters are missing, etc
javax.crypto.BadPaddingException - if unpadding has been requested, but the
decrypted data is not bounded by the appropriate padding bytes
javax.crypto.IllegalBlockSizeException - if this cipher is a block cipher,
no padding has been requested (only in encryption mode), and the
total input length of the data processed by this cipher is not a
multiple of block size
public java.security.Key decryptKey(java.security.Key key,
byte[] encrypted,
AlgorithmMethod algo)
throws java.security.InvalidKeyException,
javax.crypto.BadPaddingException,
javax.crypto.IllegalBlockSizeException,
java.security.NoSuchAlgorithmException
decryptKey in class DOMEncryptionMethodjava.security.InvalidKeyException
javax.crypto.BadPaddingException
javax.crypto.IllegalBlockSizeException
java.security.NoSuchAlgorithmException
public byte[] encrypt(java.security.Key key,
byte[] data,
EncryptedType type)
throws java.security.InvalidKeyException,
javax.crypto.IllegalBlockSizeException
DOMEncryptionMethod
encrypt in class DOMEncryptionMethodkey - the encryption keydata - the data bytes to be encrytped
java.security.InvalidKeyException - if the key is improperly encoded, of
the wrong type, or parameters are missing, etc
javax.crypto.IllegalBlockSizeException - if this cipher is a block cipher,
no padding has been requested (only in encryption mode), and the
total input length of the data processed by this cipher is not a
multiple of block size
public byte[] wrap(java.security.Key key,
java.security.Key toBeWrapped)
throws java.security.InvalidKeyException,
javax.crypto.IllegalBlockSizeException
DOMEncryptionMethod
wrap in class DOMEncryptionMethodkey - the encryption keytoBeWrapped - the key to be encrypted
java.security.InvalidKeyException - if the key is improperly encoded, of
the wrong type, or parameters are missing, etc
javax.crypto.IllegalBlockSizeException - if this cipher is a block cipher,
no padding has been requested (only in encryption mode), and the
total input length of the data processed by this cipher is not a
multiple of block size
public byte[] unwrap(java.security.Key key,
byte[] encrypted)
throws java.security.InvalidKeyException,
javax.crypto.BadPaddingException,
javax.crypto.IllegalBlockSizeException
DOMEncryptionMethod
unwrap in class DOMEncryptionMethodkey - the decryption keyencrypted - the wrapped key to be unwrapped
java.security.InvalidKeyException - if the key is improperly encoded, of
the wrong type, or parameters are missing, etc
javax.crypto.BadPaddingException - if unpadding has been requested, but the
decrypted data is not bounded by the appropriate padding bytes
javax.crypto.IllegalBlockSizeException - if this cipher is a block cipher,
no padding has been requested (only in encryption mode), and the
total input length of the data processed by this cipher is not a
multiple of block size
public java.security.Key unwrap(java.security.Key key,
byte[] encrypted,
AlgorithmMethod algo)
throws java.security.InvalidKeyException,
javax.crypto.BadPaddingException,
javax.crypto.IllegalBlockSizeException,
java.security.NoSuchAlgorithmException
DOMEncryptionMethod
unwrap in class DOMEncryptionMethodkey - the decryption keyencrypted - the wrapped key to be unwrappedalgo - the algorithm of the decrypted key
java.security.InvalidKeyException - if the key is improperly encoded, of
the wrong type, or parameters are missing, etc
javax.crypto.BadPaddingException - if unpadding has been requested, but the
decrypted data is not bounded by the appropriate padding bytes
javax.crypto.IllegalBlockSizeException - if this cipher is a block cipher,
no padding has been requested (only in encryption mode), and the
total input length of the data processed by this cipher is not a
multiple of block size
java.security.NoSuchAlgorithmException
|
XML Security, 1.6 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||