public class ZCert extends Object
To exchange certificates, send the public file via some secure route. Certificates are not signed but are text files that can be verified by eye.
Certificates are stored in the ZeroMQ Property Language format.
They have two sections, "metadata" and "curve".
The first contains a list of 'name = value' pairs, one per line.
Values may be enclosed in quotes.
The curve section has a 'public-key = key-value' and, for secret certificates, a
'secret-key = key-value' line.
The key-value is a Z85-encoded CURVE key.
| Modifier and Type | Method and Description |
|---|---|
void |
apply(ZMQ.Socket socket) |
ZMetadata |
getMetadata() |
byte[] |
getPublicKey() |
String |
getPublicKeyAsZ85() |
byte[] |
getSecretKey() |
String |
getSecretKeyAsZ85() |
File |
savePublic(String filename)
Saves the public key to a file.
|
File |
saveSecret(String filename)
Saves the public and secret keys to a file.
|
void |
setMeta(String key,
String value) |
public ZCert(String publickey)
public ZCert()
public byte[] getPublicKey()
public byte[] getSecretKey()
public String getPublicKeyAsZ85()
public String getSecretKeyAsZ85()
public void apply(ZMQ.Socket socket)
public ZMetadata getMetadata()
public File savePublic(String filename) throws IOException
filename - the path of the file to save the certificate into.IOException - if unable to save the file.public File saveSecret(String filename) throws IOException
filename - the path of the file to save the certificate into.IOException - if unable to save the file.Copyright © 2019. All rights reserved.