public class CertificateBag extends SafeBag
SafeBag
,
Attributes
Modifier | Constructor and Description |
---|---|
protected |
CertificateBag()
Default constructor.
|
|
CertificateBag(X509Certificate certificate)
Creates a new CertificateBag from an already existing
certificate.
|
|
CertificateBag(X509Certificate certificate,
java.lang.String friendlyName,
byte[] localKeyID)
Creates a new CertificateBag from an already existing
certificate, a friendlyName and a locakKeyID.
|
Modifier and Type | Method and Description |
---|---|
void |
decode(ASN1Object obj)
Decodes the CertificateBag given as ASN1Object.
|
X509Certificate |
getCertificate()
Returns the certificate of this CertificateBag.
|
static X509Certificate[] |
getCertificates(CertificateBag[] certificates)
This method can be used to convert a CertificateBag array to
a Certificate array.
|
ASN1Object |
toASN1Object()
Returns this CertificateBag as ASN1Object.
|
java.lang.String |
toString()
Returns a String representation of this CertificateBag.
|
create, encodeSafeContents, encodeSafeContentsAsASN1Object, getBagType, parseSafeContents, parseSafeContents, register
getAttributes, getFriendlyName, getLocalKeyID, setAttributes, setFriendlyName, setLocalKeyID
protected CertificateBag()
public CertificateBag(X509Certificate certificate)
certificate
- the certificatepublic CertificateBag(X509Certificate certificate, java.lang.String friendlyName, byte[] localKeyID)
certiticate
- the certificatefriendlyName
- the friendly namelocalKeyID
- the local key idpublic static X509Certificate[] getCertificates(CertificateBag[] certificates)
certificates
- the certificates as PKCS12 certspublic X509Certificate getCertificate()
public void decode(ASN1Object obj) throws CodingException
obj
- the CertificateBag as ASN1ObjectCodingException
- if the CertificateBag cannot be decodedpublic ASN1Object toASN1Object() throws CodingException
CodingException
- if an de/encoding error occurs