public class CertOrEncCert extends java.lang.Object implements ASN1Type
CertOrEncCert ::= CHOICE {
certificate [0] Certificate,
encryptedCert [1] EncryptedValue
}
| Modifier and Type | Field and Description |
|---|---|
static byte |
TAG_CERTIFICATE
CertOrEncCert type 'certificate'.
|
static byte |
TAG_ENCRYPTED_CERT
CertOrEncCert type 'encryptedCert'.
|
| Constructor and Description |
|---|
CertOrEncCert(ASN1Object obj)
Creates a
CertOrEncCert object from an ASN1Object. |
CertOrEncCert(int type,
java.lang.Object value)
Creates a new
CertOrEncCert object with the specified type and
value. |
| Modifier and Type | Method and Description |
|---|---|
void |
decode(ASN1Object obj)
Decodes a CertOrEncCert structure from an
ASN1Object. |
int |
getType()
Returns the type of CertOrEncCert.
|
java.lang.Object |
getValue()
Returns the value of CertOrEncCert.
|
ASN1Object |
toASN1Object()
Encodes this
CertOrEncCert as an ASN1Object. |
java.lang.String |
toString()
Creates a text representation of the ASN.1 structure of this
CertOrEncCert object. |
public static final byte TAG_CERTIFICATE
public static final byte TAG_ENCRYPTED_CERT
public CertOrEncCert(int type,
java.lang.Object value)
throws java.lang.IllegalArgumentException
CertOrEncCert object with the specified type and
value.
Only the following combinations of type and value are supported:
CertificateEncryptedValuetype - the type of CertOrEncCertvalue - the value of CertOrEncCertjava.lang.IllegalArgumentException - thrown if the 'value' parameter is null or an invalid
type/value combination is detectedpublic CertOrEncCert(ASN1Object obj) throws CodingException, java.lang.IllegalArgumentException
CertOrEncCert object from an ASN1Object.
The ASN1Object must be an CertOrEncCert structure.
obj - the ASN.1 representation of a CertOrEncCert structureCodingException - thrown if an errors occurs while decoding the ANS1Objectjava.lang.IllegalArgumentException - thrown if the parameter is nullpublic int getType()
public java.lang.Object getValue()
Only the following object-types can be returned based on the type of CertOrEncCert:
CertificateEncryptedValue
The value is returned as an Object, which can then cast to
the appropriate object-type based on the type of CertOrEncCert.
public void decode(ASN1Object obj) throws CodingException, java.lang.IllegalArgumentException
ASN1Object.
decode in interface ASN1Typeobj - an ASN.1 representation of a CertOrEncCert structureCodingException - thrown if an errors occurs while decoding the ANS1Objectjava.lang.IllegalArgumentException - thrown if the parameter is nullpublic ASN1Object toASN1Object()
CertOrEncCert as an ASN1Object.
toASN1Object in interface ASN1Typepublic java.lang.String toString()
CertOrEncCert object.toString in class java.lang.Object