public interface AuthHandler
NKeys
. Since
NKeys depend on a private seed, we do not handle them directly in the client library. Instead you can
work with them inside an AuthHandler that only makes the public key available to the library.
public String getID() {
try {
return this.nkey.getPublicKey();
} catch (GeneralSecurityException|IOException ex) {
return null;
}
}
public byte[] sign(byte[] nonce) {
try {
return this.nkey.sign(nonce);
} catch (GeneralSecurityException|IOException ex) {
return null;
}
}
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getID()
getID should return a public key associated with a client key known to the server.
|
byte[] |
sign(byte[] nonce)
Sign is called by the library when the server sends a nonce.
|
byte[] sign(byte[] nonce)
nonce
- the nonce to signjava.lang.String getID()