Class PKCS12SafeBag
java.lang.Object
org.bouncycastle.pkcs.PKCS12SafeBag
Holding class for a PKCS#12 SafeBag (RFC 7292).
getBagValue() returns a typed view
of the payload appropriate to getType().-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.bouncycastle.asn1.ASN1ObjectIdentifierStandardpkcs-9-at-friendlyNameattribute OID.static final org.bouncycastle.asn1.ASN1ObjectIdentifierStandardpkcs-9-at-localKeyIdattribute OID. -
Constructor Summary
ConstructorsConstructorDescriptionPKCS12SafeBag(org.bouncycastle.asn1.pkcs.SafeBag safeBag) Wrap an existing parsed SafeBag ASN.1 structure. -
Method Summary
Modifier and TypeMethodDescriptionorg.bouncycastle.asn1.pkcs.Attribute[]Return the bag attributes (e.g. friendlyName, localKeyId) attached to this bag.Return the bag value as a typed object appropriate togetType(): pkcs8ShroudedKeyBag →PKCS8EncryptedPrivateKeyInfo, certBag →X509CertificateHolder, keyBag →PrivateKeyInfo, crlBag →X509CRLHolder, secretBag →PKCS12SecretBag.org.bouncycastle.asn1.ASN1ObjectIdentifiergetType()Return the BagId giving the type of content in the bag.org.bouncycastle.asn1.pkcs.SafeBagReturn the underlying ASN.1 structure for this safe bag.
-
Field Details
-
friendlyNameAttribute
public static final org.bouncycastle.asn1.ASN1ObjectIdentifier friendlyNameAttributeStandardpkcs-9-at-friendlyNameattribute OID. -
localKeyIdAttribute
public static final org.bouncycastle.asn1.ASN1ObjectIdentifier localKeyIdAttributeStandardpkcs-9-at-localKeyIdattribute OID.
-
-
Constructor Details
-
PKCS12SafeBag
public PKCS12SafeBag(org.bouncycastle.asn1.pkcs.SafeBag safeBag) Wrap an existing parsed SafeBag ASN.1 structure.- Parameters:
safeBag- the underlying SafeBag.
-
-
Method Details
-
toASN1Structure
public org.bouncycastle.asn1.pkcs.SafeBag toASN1Structure()Return the underlying ASN.1 structure for this safe bag.- Returns:
- a SafeBag
-
getType
public org.bouncycastle.asn1.ASN1ObjectIdentifier getType()Return the BagId giving the type of content in the bag.- Returns:
- the bagId
-
getAttributes
public org.bouncycastle.asn1.pkcs.Attribute[] getAttributes()Return the bag attributes (e.g. friendlyName, localKeyId) attached to this bag.- Returns:
- the attributes as an array, or
nullif none are present.
-
getBagValue
Return the bag value as a typed object appropriate togetType(): pkcs8ShroudedKeyBag →PKCS8EncryptedPrivateKeyInfo, certBag →X509CertificateHolder, keyBag →PrivateKeyInfo, crlBag →X509CRLHolder, secretBag →PKCS12SecretBag. Other types are returned as their raw ASN.1 encoding.- Returns:
- a typed view of this bag's value.
-