Class 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 the Certificate.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Certificate asCertificate()
      Return the Certificate belonging to this key material.
      java.lang.String getFingerprint()
      Return the fingerprint of the certificate as 40 lowercase hex characters.
      java.io.InputStream getInputStream()
      Return an InputStream of the binary representation of the secret key.
      java.util.List<java.lang.Long> getSubkeyIds()
      Return a Set containing key-ids of subkeys.
      java.lang.Long getTag()
      Return the tag belonging to this key material.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 certificate
        fingerprint - fingerprint (lowercase hex characters)
        subkeyIds - list of subkey ids
        tag - tag
      • Certificate

        public Certificate​(Certificate cert,
                           java.lang.Long tag)
        Copy constructor to assign a new tag to the Certificate.
        Parameters:
        cert - certificate
        tag - tag
    • Method Detail

      • getFingerprint

        public java.lang.String getFingerprint()
        Description copied from interface: KeyMaterial
        Return the fingerprint of the certificate as 40 lowercase hex characters. TODO: Allow OpenPGP V5 fingerprints
        Specified by:
        getFingerprint in interface KeyMaterial
        Returns:
        fingerprint
      • getInputStream

        public java.io.InputStream getInputStream()
        Description copied from interface: KeyMaterial
        Return an InputStream of the binary representation of the secret key.
        Specified by:
        getInputStream in interface KeyMaterial
        Returns:
        input stream
      • getTag

        public java.lang.Long getTag()
        Description copied from interface: KeyMaterial
        Return 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:
        getTag in interface KeyMaterial
        Returns:
        tag
      • getSubkeyIds

        public java.util.List<java.lang.Long> getSubkeyIds()
        Description copied from interface: KeyMaterial
        Return a Set containing key-ids of subkeys.
        Specified by:
        getSubkeyIds in interface KeyMaterial
        Returns:
        subkeys