Package org.mozilla.jss.pkcs12
Class CertBag
java.lang.Object
org.mozilla.jss.pkcs12.CertBag
- All Implemented Interfaces:
ASN1Value
A PKCS #12 cert bag.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
A Template class for decoding CertBags from their BER encoding. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ANY
private static final OBJECT_IDENTIFIER
private OBJECT_IDENTIFIER
static final OBJECT_IDENTIFIER
private SEQUENCE
private static final Tag
private static final CertBag.Template
static final OBJECT_IDENTIFIER
-
Constructor Summary
ConstructorsConstructorDescriptionCertBag
(OBJECT_IDENTIFIER certType, ASN1Value cert) Creates a CertBag from a type and a cert. -
Method Summary
Modifier and TypeMethodDescriptionvoid
encode
(OutputStream ostream) Write this value's DER encoding to an output stream using its own base tag.void
encode
(Tag implicitTag, OutputStream ostream) Write this value's DER encoding to an output stream using an implicit tag.getCert()
Returns the cert field of the CertBag.Returns the certType field of the CertBag.Returns the cert field of the CertBag based on its type.getTag()
Returns the base tag for this type, not counting any tags that may be imposed on it by its context.static CertBag.Template
-
Field Details
-
CERT_TYPES
-
X509_CERT_TYPE
-
SDSI_CERT_TYPE
-
certType
-
cert
-
sequence
-
TAG
-
templateInstance
-
-
Constructor Details
-
CertBag
Creates a CertBag from a type and a cert.
-
-
Method Details
-
getCertType
Returns the certType field of the CertBag. Currently defined types are:- X509Certificate (
X509_CERT_TYPE
) - SDSICertificate (
SDSI_CERT_TYPE
)
- X509Certificate (
-
getCert
Returns the cert field of the CertBag. -
getInterpretedCert
Returns the cert field of the CertBag based on its type.- If the type is
X509_CERT_TYPE
, returns and OCTET_STRING which is the DER-encoding of an X.509 certificate. - If the type is
SDSI_CERT_TYPE
, returns an IA5String. - For all other types, returns an ANY.
- Throws:
InvalidBERException
- If the cert is not encoded correctly.
- If the type is
-
getTag
Description copied from interface:ASN1Value
Returns the base tag for this type, not counting any tags that may be imposed on it by its context. -
encode
Description copied from interface:ASN1Value
Write this value's DER encoding to an output stream using its own base tag.- Specified by:
encode
in interfaceASN1Value
- Parameters:
ostream
- Output stream.- Throws:
IOException
- If an error occurred.
-
encode
Description copied from interface:ASN1Value
Write this value's DER encoding to an output stream using an implicit tag.- Specified by:
encode
in interfaceASN1Value
- Parameters:
implicitTag
- Implicit tag.ostream
- Output stream.- Throws:
IOException
- If an error occurred.
-
getTemplate
-