public class ZCertStore
extends java.lang.Object
ZCert
class does the
work of managing a single certificate.
Those files need to be in ZMP-Format which is created by ZConfig
Modifier and Type | Class and Description |
---|---|
static interface |
ZCertStore.Fingerprinter |
static class |
ZCertStore.Hasher |
private static interface |
ZCertStore.IFileVisitor |
static class |
ZCertStore.Timestamper |
Modifier and Type | Field and Description |
---|---|
private ZCertStore.Fingerprinter |
finger |
private java.util.Map<java.io.File,byte[]> |
fingerprints |
private java.io.File |
location |
private java.util.Map<java.lang.String,ZMetadata> |
publicKeys |
Constructor and Description |
---|
ZCertStore(java.lang.String location)
Create a Certificate Store at that file system folder location
|
ZCertStore(java.lang.String location,
ZCertStore.Fingerprinter fingerprinter) |
Modifier and Type | Method and Description |
---|---|
(package private) boolean |
checkForChanges()
Check if files in the certificate folders have been added or removed.
|
boolean |
containsPublicKey(byte[] publicKey)
Check if a public key is in the certificate store.
|
boolean |
containsPublicKey(java.lang.String publicKey)
check if a z85-based public key is in the certificate store.
|
(package private) int |
getCertificatesCount() |
ZMetadata |
getMetadata(java.lang.String publicKey) |
private void |
loadFiles() |
private boolean |
modified(byte[] fingerprint,
java.io.File path) |
(package private) boolean |
reloadIfNecessary() |
private boolean |
traverseDirectory(java.io.File root,
ZCertStore.IFileVisitor visitor) |
private final java.io.File location
private final java.util.Map<java.io.File,byte[]> fingerprints
private final java.util.Map<java.lang.String,ZMetadata> publicKeys
private final ZCertStore.Fingerprinter finger
public ZCertStore(java.lang.String location)
location
- public ZCertStore(java.lang.String location, ZCertStore.Fingerprinter fingerprinter)
private boolean traverseDirectory(java.io.File root, ZCertStore.IFileVisitor visitor)
public boolean containsPublicKey(byte[] publicKey)
publicKey
- needs to be a 32 byte array representing the public keypublic boolean containsPublicKey(java.lang.String publicKey)
publicKey
- public ZMetadata getMetadata(java.lang.String publicKey)
private void loadFiles()
int getCertificatesCount()
boolean reloadIfNecessary()
boolean checkForChanges()
private boolean modified(byte[] fingerprint, java.io.File path)