Class Certificate
- java.lang.Object
-
- pgp.certificate_store.certificate.Certificate
-
- All Implemented Interfaces:
KeyMaterial
public class Certificate extends java.lang.Object implements KeyMaterial
OpenPGP certificate (public key).
-
-
Constructor Summary
Constructors Constructor Description Certificate(byte[] bytes, java.lang.String fingerprint, java.util.List<java.lang.Long> subkeyIds, java.lang.Long tag)Certificate constructor.Certificate(Certificate cert, java.lang.Long tag)Copy constructor to assign a new tag to theCertificate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CertificateasCertificate()Return theCertificatebelonging to this key material.java.lang.StringgetFingerprint()Return the fingerprint of the certificate as 40 lowercase hex characters.java.io.InputStreamgetInputStream()Return anInputStreamof the binary representation of the secret key.java.util.List<java.lang.Long>getSubkeyIds()Return aSetcontaining key-ids of subkeys.java.lang.LonggetTag()Return the tag belonging to this key material.
-
-
-
Constructor Detail
-
Certificate
public Certificate(byte[] bytes, java.lang.String fingerprint, java.util.List<java.lang.Long> subkeyIds, java.lang.Long tag)Certificate constructor.- Parameters:
bytes- encoding of the certificatefingerprint- fingerprint (lowercase hex characters)subkeyIds- list of subkey idstag- tag
-
Certificate
public Certificate(Certificate cert, java.lang.Long tag)
Copy constructor to assign a new tag to theCertificate.- Parameters:
cert- certificatetag- tag
-
-
Method Detail
-
getFingerprint
public java.lang.String getFingerprint()
Description copied from interface:KeyMaterialReturn the fingerprint of the certificate as 40 lowercase hex characters. TODO: Allow OpenPGP V5 fingerprints- Specified by:
getFingerprintin interfaceKeyMaterial- Returns:
- fingerprint
-
asCertificate
public Certificate asCertificate()
Description copied from interface:KeyMaterialReturn theCertificatebelonging to this key material. If this is already aCertificate, return this. If this is aKey, extract theCertificateand return it.- Specified by:
asCertificatein interfaceKeyMaterial- Returns:
- certificate
-
getInputStream
public java.io.InputStream getInputStream()
Description copied from interface:KeyMaterialReturn anInputStreamof the binary representation of the secret key.- Specified by:
getInputStreamin interfaceKeyMaterial- Returns:
- input stream
-
getTag
public java.lang.Long getTag()
Description copied from interface:KeyMaterialReturn the tag belonging to this key material. The tag can be used to keep an application cache in sync with what is in the directory.- Specified by:
getTagin interfaceKeyMaterial- Returns:
- tag
-
getSubkeyIds
public java.util.List<java.lang.Long> getSubkeyIds()
Description copied from interface:KeyMaterialReturn aSetcontaining key-ids of subkeys.- Specified by:
getSubkeyIdsin interfaceKeyMaterial- Returns:
- subkeys
-
-