Package pgp.cert_d

Interface PGPCertificateDirectory.Backend

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      pgp.certificate_store.certificate.Certificate doInsert​(java.io.InputStream data, pgp.certificate_store.certificate.KeyMaterialMerger merge)
      Insert a Certificate identified by its fingerprint into the directory.
      pgp.certificate_store.certificate.KeyMaterial doInsertTrustRoot​(java.io.InputStream data, pgp.certificate_store.certificate.KeyMaterialMerger merge)
      Insert a Key or Certificate as trust-root.
      pgp.certificate_store.certificate.Certificate doInsertWithSpecialName​(java.lang.String specialName, java.io.InputStream data, pgp.certificate_store.certificate.KeyMaterialMerger merge)
      Insert a Key or Certificate under the given special name.
      PGPCertificateDirectory.LockingMechanism getLock()
      Get the locking mechanism to write-lock the backend.
      java.lang.Long getTagForFingerprint​(java.lang.String fingerprint)
      Calculate the tag of the certificate with the given fingerprint.
      java.lang.Long getTagForSpecialName​(java.lang.String specialName)
      Calculate the tag of the certificate identified by the given special name.
      pgp.certificate_store.certificate.Certificate readByFingerprint​(java.lang.String fingerprint)
      Read a Certificate by its OpenPGP fingerprint.
      pgp.certificate_store.certificate.KeyMaterial readBySpecialName​(java.lang.String specialName)
      Read a Certificate or Key by the given special name.
      java.util.Iterator<pgp.certificate_store.certificate.Certificate> readItems()
      Return an Iterator of all Certificates in the store, except for certificates stored under a special name.
    • Method Detail

      • readByFingerprint

        pgp.certificate_store.certificate.Certificate readByFingerprint​(java.lang.String fingerprint)
                                                                 throws pgp.certificate_store.exception.BadNameException,
                                                                        java.io.IOException,
                                                                        pgp.certificate_store.exception.BadDataException
        Read a Certificate by its OpenPGP fingerprint.
        Parameters:
        fingerprint - fingerprint
        Returns:
        certificate
        Throws:
        pgp.certificate_store.exception.BadNameException - if the fingerprint is malformed
        java.io.IOException - in case of an IO error
        pgp.certificate_store.exception.BadDataException - if the certificate contains bad data
      • readBySpecialName

        pgp.certificate_store.certificate.KeyMaterial readBySpecialName​(java.lang.String specialName)
                                                                 throws pgp.certificate_store.exception.BadNameException,
                                                                        java.io.IOException,
                                                                        pgp.certificate_store.exception.BadDataException
        Read a Certificate or Key by the given special name.
        Parameters:
        specialName - special name
        Returns:
        certificate or key
        Throws:
        pgp.certificate_store.exception.BadNameException - if the special name is not known
        java.io.IOException - in case of an IO error
        pgp.certificate_store.exception.BadDataException - if the certificate contains bad data
      • readItems

        java.util.Iterator<pgp.certificate_store.certificate.Certificate> readItems()
        Return an Iterator of all Certificates in the store, except for certificates stored under a special name.
        Returns:
        iterator
      • doInsertTrustRoot

        pgp.certificate_store.certificate.KeyMaterial doInsertTrustRoot​(java.io.InputStream data,
                                                                        pgp.certificate_store.certificate.KeyMaterialMerger merge)
                                                                 throws pgp.certificate_store.exception.BadDataException,
                                                                        java.io.IOException
        Insert a Key or Certificate as trust-root.
        Parameters:
        data - input stream containing the key material
        merge - callback to merge the key material with existing key material
        Returns:
        merged or inserted key material
        Throws:
        pgp.certificate_store.exception.BadDataException - if the data stream or existing key material contains bad data
        java.io.IOException - in case of an IO error
      • doInsert

        pgp.certificate_store.certificate.Certificate doInsert​(java.io.InputStream data,
                                                               pgp.certificate_store.certificate.KeyMaterialMerger merge)
                                                        throws java.io.IOException,
                                                               pgp.certificate_store.exception.BadDataException
        Insert a Certificate identified by its fingerprint into the directory.
        Parameters:
        data - input stream containing the certificate data
        merge - callback to merge the certificate with existing key material
        Returns:
        merged or inserted certificate
        Throws:
        java.io.IOException - in case of an IO error
        pgp.certificate_store.exception.BadDataException - if the data stream or existing certificate contains bad data
      • doInsertWithSpecialName

        pgp.certificate_store.certificate.Certificate doInsertWithSpecialName​(java.lang.String specialName,
                                                                              java.io.InputStream data,
                                                                              pgp.certificate_store.certificate.KeyMaterialMerger merge)
                                                                       throws java.io.IOException,
                                                                              pgp.certificate_store.exception.BadDataException,
                                                                              pgp.certificate_store.exception.BadNameException
        Insert a Key or Certificate under the given special name.
        Parameters:
        specialName - special name to identify the key material with
        data - data stream containing the key or certificate
        merge - callback to merge the key/certificate with existing key material
        Returns:
        certificate component of the merged or inserted key material
        Throws:
        java.io.IOException - in case of an IO error
        pgp.certificate_store.exception.BadDataException - if the data stream or existing key material contains bad data
        pgp.certificate_store.exception.BadNameException - if the special name is not known
      • getTagForFingerprint

        java.lang.Long getTagForFingerprint​(java.lang.String fingerprint)
                                     throws pgp.certificate_store.exception.BadNameException,
                                            java.io.IOException
        Calculate the tag of the certificate with the given fingerprint.
        Parameters:
        fingerprint - fingerprint
        Returns:
        tag
        Throws:
        pgp.certificate_store.exception.BadNameException - if the fingerprint is malformed
        java.io.IOException - in case of an IO error
        java.lang.IllegalArgumentException - if the certificate does not exist
      • getTagForSpecialName

        java.lang.Long getTagForSpecialName​(java.lang.String specialName)
                                     throws pgp.certificate_store.exception.BadNameException,
                                            java.io.IOException
        Calculate the tag of the certificate identified by the given special name.
        Parameters:
        specialName - special name
        Returns:
        tag
        Throws:
        pgp.certificate_store.exception.BadNameException - if the special name is not known
        java.io.IOException - in case of an IO error
        java.lang.IllegalArgumentException - if the certificate or key does not exist