Package pgp.cert_d

Interface WritingPGPCertificateDirectory

  • All Known Implementing Classes:
    PGPCertificateDirectory

    public interface WritingPGPCertificateDirectory
    Interface for a writing OpenPGP certificate directory.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      pgp.certificate_store.certificate.KeyMaterial getTrustRoot()
      Return the certificate or key identified by the special name
      pgp.certificate_store.certificate.Certificate insert​(java.io.InputStream data, pgp.certificate_store.certificate.KeyMaterialMerger merge)
      Insert a certificate identified by its fingerprint.
      pgp.certificate_store.certificate.KeyMaterial insertTrustRoot​(java.io.InputStream data, pgp.certificate_store.certificate.KeyMaterialMerger merge)
      Insert a key or certificate under the special name
      pgp.certificate_store.certificate.Certificate insertWithSpecialName​(java.lang.String specialName, java.io.InputStream data, pgp.certificate_store.certificate.KeyMaterialMerger merge)
      Insert a certificate or key under the given special name.
      pgp.certificate_store.certificate.Certificate tryInsert​(java.io.InputStream data, pgp.certificate_store.certificate.KeyMaterialMerger merge)
      Insert a certificate identified by its fingerprint.
      pgp.certificate_store.certificate.KeyMaterial tryInsertTrustRoot​(java.io.InputStream data, pgp.certificate_store.certificate.KeyMaterialMerger merge)
      Insert a key or certificate under the special name
      pgp.certificate_store.certificate.Certificate tryInsertWithSpecialName​(java.lang.String specialName, java.io.InputStream data, pgp.certificate_store.certificate.KeyMaterialMerger merge)
      Insert a certificate or key under the given special name.
    • Method Detail

      • getTrustRoot

        pgp.certificate_store.certificate.KeyMaterial getTrustRoot()
                                                            throws java.io.IOException,
                                                                   pgp.certificate_store.exception.BadDataException
        Return the certificate or key identified by the special name
        trust-root
        .
        Returns:
        trust-root key or certificate
        Throws:
        java.io.IOException - in case of an IO error
        pgp.certificate_store.exception.BadDataException - if the certificate contains bad data
      • insertTrustRoot

        pgp.certificate_store.certificate.KeyMaterial insertTrustRoot​(java.io.InputStream data,
                                                                      pgp.certificate_store.certificate.KeyMaterialMerger merge)
                                                               throws java.io.IOException,
                                                                      pgp.certificate_store.exception.BadDataException,
                                                                      java.lang.InterruptedException
        Insert a key or certificate under the special name
        trust-root
        . This method blocks until the key material has been written.
        Parameters:
        data - input stream containing the key or certificate
        merge - key material merger to merge the key or certificate with existing key material
        Returns:
        the merged or inserted key or certificate
        Throws:
        java.io.IOException - in case of an IO error
        pgp.certificate_store.exception.BadDataException - if the data stream or the existing trust-root key material contains bad data
        java.lang.InterruptedException - if the thread is interrupted
      • tryInsertTrustRoot

        pgp.certificate_store.certificate.KeyMaterial tryInsertTrustRoot​(java.io.InputStream data,
                                                                         pgp.certificate_store.certificate.KeyMaterialMerger merge)
                                                                  throws java.io.IOException,
                                                                         pgp.certificate_store.exception.BadDataException
        Insert a key or certificate under the special name
        trust-root
        . Contrary to insertTrustRoot(InputStream, KeyMaterialMerger), this method does not block. Instead, it returns null if the write-lock cannot be obtained.
        Parameters:
        data - input stream containing the key or certificate
        merge - key material merger to merge the key or certificate with existing key material
        Returns:
        the merged or inserted key or certificate, or null if the write-lock cannot be obtained
        Throws:
        java.io.IOException - in case of an IO error
        pgp.certificate_store.exception.BadDataException - if the thread is interrupted
      • insert

        pgp.certificate_store.certificate.Certificate insert​(java.io.InputStream data,
                                                             pgp.certificate_store.certificate.KeyMaterialMerger merge)
                                                      throws java.io.IOException,
                                                             pgp.certificate_store.exception.BadDataException,
                                                             java.lang.InterruptedException
        Insert a certificate identified by its fingerprint. This method blocks until the certificate has been written.
        Parameters:
        data - input stream containing the certificate data
        merge - merge callback to merge the certificate with existing certificate material
        Returns:
        the 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
        java.lang.InterruptedException - if the thread is interrupted
      • tryInsert

        pgp.certificate_store.certificate.Certificate tryInsert​(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. Contrary to insert(InputStream, KeyMaterialMerger), this method does not block. Instead, it returns null if the write-lock cannot be obtained.
        Parameters:
        data - input stream containing the certificate data
        merge - merge callback to merge the certificate with existing certificate material
        Returns:
        the 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
      • insertWithSpecialName

        pgp.certificate_store.certificate.Certificate insertWithSpecialName​(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,
                                                                            java.lang.InterruptedException
        Insert a certificate or key under the given special name. This method blocks until the certificate/key has been written.
        Parameters:
        specialName - special name under which the key material shall be inserted
        data - input stream containing the key/certificate data
        merge - callback to merge the key/certificate with existing key material
        Returns:
        certificate component of the merged or inserted key material data
        Throws:
        java.io.IOException - in case of an IO error
        pgp.certificate_store.exception.BadDataException - if the data stream or the existing certificate contains bad data
        pgp.certificate_store.exception.BadNameException - if the special name is not known
        java.lang.InterruptedException - if the thread is interrupted
      • tryInsertWithSpecialName

        pgp.certificate_store.certificate.Certificate tryInsertWithSpecialName​(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 certificate or key under the given special name. Contrary to insertWithSpecialName(String, InputStream, KeyMaterialMerger), this method does not block. Instead, it returns null if the write-lock cannot be obtained.
        Parameters:
        specialName - special name under which the key material shall be inserted
        data - input stream containing the key material
        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