Package pgp.cert_d
Interface WritingPGPCertificateDirectory
-
- All Known Implementing Classes:
PGPCertificateDirectory
public interface WritingPGPCertificateDirectoryInterface for a writing OpenPGP certificate directory.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description pgp.certificate_store.certificate.KeyMaterialgetTrustRoot()Return the certificate or key identified by the special namepgp.certificate_store.certificate.Certificateinsert(java.io.InputStream data, pgp.certificate_store.certificate.KeyMaterialMerger merge)Insert a certificate identified by its fingerprint.pgp.certificate_store.certificate.KeyMaterialinsertTrustRoot(java.io.InputStream data, pgp.certificate_store.certificate.KeyMaterialMerger merge)Insert a key or certificate under the special namepgp.certificate_store.certificate.CertificateinsertWithSpecialName(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.CertificatetryInsert(java.io.InputStream data, pgp.certificate_store.certificate.KeyMaterialMerger merge)Insert a certificate identified by its fingerprint.pgp.certificate_store.certificate.KeyMaterialtryInsertTrustRoot(java.io.InputStream data, pgp.certificate_store.certificate.KeyMaterialMerger merge)Insert a key or certificate under the special namepgp.certificate_store.certificate.CertificatetryInsertWithSpecialName(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.BadDataExceptionReturn the certificate or key identified by the special nametrust-root
.- Returns:
- trust-root key or certificate
- Throws:
java.io.IOException- in case of an IO errorpgp.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.InterruptedExceptionInsert a key or certificate under the special nametrust-root
. This method blocks until the key material has been written.- Parameters:
data- input stream containing the key or certificatemerge- 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 errorpgp.certificate_store.exception.BadDataException- if the data stream or the existing trust-root key material contains bad datajava.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.BadDataExceptionInsert a key or certificate under the special nametrust-root
. Contrary toinsertTrustRoot(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 certificatemerge- 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 errorpgp.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.InterruptedExceptionInsert a certificate identified by its fingerprint. This method blocks until the certificate has been written.- Parameters:
data- input stream containing the certificate datamerge- 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 errorpgp.certificate_store.exception.BadDataException- if the data stream or existing certificate contains bad datajava.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.BadDataExceptionInsert a certificate identified by its fingerprint. Contrary toinsert(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 datamerge- 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 errorpgp.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.InterruptedExceptionInsert 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 inserteddata- input stream containing the key/certificate datamerge- 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 errorpgp.certificate_store.exception.BadDataException- if the data stream or the existing certificate contains bad datapgp.certificate_store.exception.BadNameException- if the special name is not knownjava.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.BadNameExceptionInsert a certificate or key under the given special name. Contrary toinsertWithSpecialName(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 inserteddata- input stream containing the key materialmerge- 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 errorpgp.certificate_store.exception.BadDataException- if the data stream or existing key material contains bad datapgp.certificate_store.exception.BadNameException- if the special name is not known
-
-