Class ZCertStore
java.lang.Object
org.zeromq.ZCertStore
To authenticate new clients using the ZeroMQ CURVE security mechanism,
we have to check that the client's public key matches a key we know and
accept. There are numerous ways to store accepted client public keys.
The mechanism CZMQ implements is "certificates" (plain text files) held
in a "certificate store" (a disk directory). This class works with such
certificate stores, and lets you easily load them from disk, and check
if a given client public key is known or not. The
ZCert class does the
work of managing a single certificate.
Those files need to be in ZMP-Format which is created by ZConfig
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic final classprivate static interfacestatic final class -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionZCertStore(String location) Create a Certificate Store at that file system folder locationZCertStore(String location, ZCertStore.Fingerprinter fingerprinter) -
Method Summary
Modifier and TypeMethodDescription(package private) booleanCheck if files in the certificate folders have been added or removed.booleancontainsPublicKey(byte[] publicKey) Check if a public key is in the certificate store.booleancontainsPublicKey(String publicKey) check if a z85-based public key is in the certificate store.(package private) intgetMetadata(String publicKey) private voidprivate boolean(package private) booleanprivate booleantraverseDirectory(File root, ZCertStore.IFileVisitor visitor)
-
Field Details
-
location
-
fingerprints
-
publicKeys
-
finger
-
-
Constructor Details
-
ZCertStore
Create a Certificate Store at that file system folder location- Parameters:
location-
-
ZCertStore
-
-
Method Details
-
traverseDirectory
-
containsPublicKey
public boolean containsPublicKey(byte[] publicKey) Check if a public key is in the certificate store.- Parameters:
publicKey- needs to be a 32 byte array representing the public key
-
containsPublicKey
check if a z85-based public key is in the certificate store. This method will scan the folder for changes on every call- Parameters:
publicKey-
-
getMetadata
-
loadFiles
private void loadFiles() -
getCertificatesCount
int getCertificatesCount() -
reloadIfNecessary
boolean reloadIfNecessary() -
checkForChanges
boolean checkForChanges()Check if files in the certificate folders have been added or removed. -
modified
-