Package pgp.cert_d
Interface PGPCertificateDirectory.Backend
-
- All Known Implementing Classes:
FileBasedCertificateDirectoryBackend,InMemoryCertificateDirectoryBackend
- Enclosing class:
- PGPCertificateDirectory
public static interface PGPCertificateDirectory.BackendStorage backend.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description pgp.certificate_store.certificate.CertificatedoInsert(java.io.InputStream data, pgp.certificate_store.certificate.KeyMaterialMerger merge)Insert aCertificateidentified by its fingerprint into the directory.pgp.certificate_store.certificate.KeyMaterialdoInsertTrustRoot(java.io.InputStream data, pgp.certificate_store.certificate.KeyMaterialMerger merge)Insert aKeyorCertificateas trust-root.pgp.certificate_store.certificate.CertificatedoInsertWithSpecialName(java.lang.String specialName, java.io.InputStream data, pgp.certificate_store.certificate.KeyMaterialMerger merge)Insert aKeyorCertificateunder the given special name.PGPCertificateDirectory.LockingMechanismgetLock()Get the locking mechanism to write-lock the backend.java.lang.LonggetTagForFingerprint(java.lang.String fingerprint)Calculate the tag of the certificate with the given fingerprint.java.lang.LonggetTagForSpecialName(java.lang.String specialName)Calculate the tag of the certificate identified by the given special name.pgp.certificate_store.certificate.CertificatereadByFingerprint(java.lang.String fingerprint)Read aCertificateby its OpenPGP fingerprint.pgp.certificate_store.certificate.KeyMaterialreadBySpecialName(java.lang.String specialName)Read aCertificateorKeyby the given special name.java.util.Iterator<pgp.certificate_store.certificate.Certificate>readItems()Return anIteratorof allCertificatesin the store, except for certificates stored under a special name.
-
-
-
Method Detail
-
getLock
PGPCertificateDirectory.LockingMechanism getLock()
Get the locking mechanism to write-lock the backend.- Returns:
- lock
-
readByFingerprint
pgp.certificate_store.certificate.Certificate readByFingerprint(java.lang.String fingerprint) throws pgp.certificate_store.exception.BadNameException, java.io.IOException, pgp.certificate_store.exception.BadDataExceptionRead aCertificateby its OpenPGP fingerprint.- Parameters:
fingerprint- fingerprint- Returns:
- certificate
- Throws:
pgp.certificate_store.exception.BadNameException- if the fingerprint is malformedjava.io.IOException- in case of an IO errorpgp.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.BadDataExceptionRead aCertificateorKeyby the given special name.- Parameters:
specialName- special name- Returns:
- certificate or key
- Throws:
pgp.certificate_store.exception.BadNameException- if the special name is not knownjava.io.IOException- in case of an IO errorpgp.certificate_store.exception.BadDataException- if the certificate contains bad data
-
readItems
java.util.Iterator<pgp.certificate_store.certificate.Certificate> readItems()
Return anIteratorof allCertificatesin 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.IOExceptionInsert aKeyorCertificateas trust-root.- Parameters:
data- input stream containing the key materialmerge- 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 datajava.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.BadDataExceptionInsert aCertificateidentified by its fingerprint into the directory.- Parameters:
data- input stream containing the certificate datamerge- callback to merge the certificate with existing key material- Returns:
- 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
-
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.BadNameExceptionInsert aKeyorCertificateunder the given special name.- Parameters:
specialName- special name to identify the key material withdata- data stream containing the key or certificatemerge- 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
-
getTagForFingerprint
java.lang.Long getTagForFingerprint(java.lang.String fingerprint) throws pgp.certificate_store.exception.BadNameException, java.io.IOExceptionCalculate the tag of the certificate with the given fingerprint.- Parameters:
fingerprint- fingerprint- Returns:
- tag
- Throws:
pgp.certificate_store.exception.BadNameException- if the fingerprint is malformedjava.io.IOException- in case of an IO errorjava.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.IOExceptionCalculate 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 knownjava.io.IOException- in case of an IO errorjava.lang.IllegalArgumentException- if the certificate or key does not exist
-
-