public class EncryptedValue extends java.lang.Object implements ASN1Type
EncryptedValue ::= SEQUENCE {
intendedAlg [0] AlgorithmIdentifier OPTIONAL,
-- the intended algorithm for which the value will be used
symmAlg [1] AlgorithmIdentifier OPTIONAL,
-- the symmetric algorithm used to encrypt the value
encSymmKey [2] BIT STRING OPTIONAL,
-- the (encrypted) symmetric key used to encrypt the value
keyAlg [3] AlgorithmIdentifier OPTIONAL,
-- algorithm used to encrypt the symmetric key
valueHint [4] OCTET STRING OPTIONAL,
-- a brief description or identifier of the encValue content
-- (may be meaningful only to the sending entity, and used only
-- if EncryptedValue might be re-examined by the sending entity
-- in the future)
encValue BIT STRING
-- the encrypted value itself
}
| Constructor and Description |
|---|
EncryptedValue(ASN1Object obj)
Creates an
EncryptedValue object from an
ASN1Object. |
EncryptedValue(byte[] encValue)
Creates a new
EncryptedValue object with the specified
component set. |
| Modifier and Type | Method and Description |
|---|---|
void |
decode(ASN1Object obj)
Decodes an EncryptedValue structure from an
ASN1Object. |
byte[] |
getEncSymmKey()
Returns the (encrypted) symmetric key used to encrypt the value, if it has
been set; otherwise
null is returned. |
byte[] |
getEncValue()
Returns the encrypted value.
|
AlgorithmID |
getIntendedAlg()
Returns the intended algorithm for which the value will be used, if it has
been set; otherwise
null is returned. |
AlgorithmID |
getKeyAlg()
Returns the algorithm used to encrypt the symmetric key, if it has been
set; otherwise
null is returned. |
AlgorithmID |
getSymmAlg()
Returns the symmetric algorithm used to encrypt the value, if it has been
set; otherwise
null is returned. |
byte[] |
getValueHint()
Returns a breif description or identifier of the encValue content, if it
has been set; otherwise
null is returned. |
void |
setEncSymmKey(byte[] encSymmKey)
Sets the (encrypted) symmetric key used to encrypt the value.
|
void |
setIntendedAlg(AlgorithmID intendedAlg)
Sets the intended algorithm for which the value will be used.
|
void |
setKeyAlg(AlgorithmID keyAlg)
Sets the algorithm used to encrypt the symmetric key.
|
void |
setSymmAlg(AlgorithmID symmAlg)
Sets the symmetric algorithm used to encrypt the value.
|
void |
setValueHint(byte[] valueHint)
Sets a breif description or identifier for the content.
|
ASN1Object |
toASN1Object()
Encodes this
EncryptedValue object as an ASN1Object. |
java.lang.String |
toString()
Creates a text representation of the ASN.1 structure of this
EncryptedValue object. |
public EncryptedValue(byte[] encValue)
EncryptedValue object with the specified
component set.encValue - the encrypted valuepublic EncryptedValue(ASN1Object obj) throws CodingException
EncryptedValue object from an
ASN1Object.obj - the ASN.1 representation of an EncryptedValue structureCodingException - thrown if an errors occurs while decoding the ANS1Objectpublic void setIntendedAlg(AlgorithmID intendedAlg)
intendedAlg - the intendedAlg componentpublic void setSymmAlg(AlgorithmID symmAlg)
symmAlg - the symmAlg componentpublic void setEncSymmKey(byte[] encSymmKey)
encSymmKey - the encSymmKey componentpublic void setKeyAlg(AlgorithmID keyAlg)
keyAlg - the keyAlg componentpublic void setValueHint(byte[] valueHint)
valueHint - the valueHint componentpublic AlgorithmID getIntendedAlg()
null is returned.public AlgorithmID getSymmAlg()
null is returned.public byte[] getEncSymmKey()
null is returned.public AlgorithmID getKeyAlg()
null is returned.public byte[] getValueHint()
null is returned.public byte[] getEncValue()
public void decode(ASN1Object obj) throws CodingException
ASN1Object.decode in interface ASN1Typeobj - an ASN.1 representation of an EncryptedValue structureCodingException - thrown if an errors occurs while decoding the ANS1Objectpublic ASN1Object toASN1Object()
EncryptedValue object as an ASN1Object.toASN1Object in interface ASN1Typepublic java.lang.String toString()
EncryptedValue object.toString in class java.lang.Object