Package com.eatthepath.noise
Class NoiseHandshakeBuilder
java.lang.Object
com.eatthepath.noise.NoiseHandshakeBuilder
A Noise handshake builder constructs NoiseHandshake
instances with known handshake patterns and roles.
In contrast to NamedProtocolHandshakeBuilder
, this builder provides compile-time checks that all required
keys are provided, but places the burden of selecting protocol components (key agreement algorithms, ciphers, and
hash algorithms) on the caller.
Callers may specify the cryptographic components of a Noise protocol by providing a full Noise protocol name…
final NoiseHandshake ikInitiatorHandshake =
NoiseHandshakeBuilder.forIKInitiator(initiatorLocalStaticKeyPair, initiatorRemoteStaticPublicKey)
.setComponentsFromProtocolName("Noise_IK_25519_ChaChaPoly_SHA256")
.build();
…or by specifying the name of each component individually:
final NoiseHandshake ikResponderHandshake =
NoiseHandshakeBuilder.forIKResponder(responderLocalStaticKeyPair)
.setKeyAgreement("25519")
.setCipher("ChaChaPoly")
.setHash("SHA256")
.build();
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Constructs a Noise handshake with the previously-specified handshake pattern, role key material and cryptographic components.static NoiseHandshakeBuilder
forI1K1Initiator
(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the initiator in an I1K1 handshake.static NoiseHandshakeBuilder
forI1K1Responder
(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the responder in an I1K1 handshake.static NoiseHandshakeBuilder
forI1KInitiator
(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the initiator in an I1K handshake.static NoiseHandshakeBuilder
forI1KResponder
(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the responder in an I1K handshake.static NoiseHandshakeBuilder
forI1NInitiator
(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the initiator in an I1N handshake.static NoiseHandshakeBuilder
Constructs a new Noise handshake builder for the responder in an I1N handshake.static NoiseHandshakeBuilder
forI1X1Initiator
(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the initiator in an I1X1 handshake.static NoiseHandshakeBuilder
forI1X1Responder
(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the responder in an I1X1 handshake.static NoiseHandshakeBuilder
forI1XInitiator
(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the initiator in an I1X handshake.static NoiseHandshakeBuilder
forI1XResponder
(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the responder in an I1X handshake.static NoiseHandshakeBuilder
forIK1Initiator
(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the initiator in an IK1 handshake.static NoiseHandshakeBuilder
forIK1Responder
(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the responder in an IK1 handshake.static NoiseHandshakeBuilder
forIKInitiator
(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the initiator in an IK handshake.static NoiseHandshakeBuilder
forIKPsk1Initiator
(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey, byte[] preSharedKey) Constructs a new Noise handshake builder for the initiator in an IKpsk1 handshake.static NoiseHandshakeBuilder
forIKPsk1Responder
(KeyPair localStaticKeyPair, byte[] preSharedKey) Constructs a new Noise handshake builder for the responder in an IKpsk1 handshake.static NoiseHandshakeBuilder
forIKPsk2Initiator
(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey, byte[] preSharedKey) Constructs a new Noise handshake builder for the initiator in an IKpsk2 handshake.static NoiseHandshakeBuilder
forIKPsk2Responder
(KeyPair localStaticKeyPair, byte[] preSharedKey) Constructs a new Noise handshake builder for the responder in an IKpsk2 handshake.static NoiseHandshakeBuilder
forIKResponder
(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the responder in an IK handshake.static NoiseHandshakeBuilder
forINInitiator
(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the initiator in an IN handshake.static NoiseHandshakeBuilder
forINPsk1Initiator
(KeyPair localStaticKeyPair, byte[] preSharedKey) Constructs a new Noise handshake builder for the initiator in an INpsk1 handshake.static NoiseHandshakeBuilder
forINPsk1Responder
(byte[] preSharedKey) Constructs a new Noise handshake builder for the responder in an INpsk1 handshake.static NoiseHandshakeBuilder
forINPsk2Initiator
(KeyPair localStaticKeyPair, byte[] preSharedKey) Constructs a new Noise handshake builder for the initiator in an INpsk2 handshake.static NoiseHandshakeBuilder
forINPsk2Responder
(byte[] preSharedKey) Constructs a new Noise handshake builder for the responder in an INpsk2 handshake.static NoiseHandshakeBuilder
Constructs a new Noise handshake builder for the responder in an IN handshake.static NoiseHandshakeBuilder
forIX1Initiator
(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the initiator in an IX1 handshake.static NoiseHandshakeBuilder
forIX1Responder
(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the responder in an IX1 handshake.static NoiseHandshakeBuilder
forIXInitiator
(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the initiator in an IX handshake.static NoiseHandshakeBuilder
forIXPsk2Initiator
(KeyPair localStaticKeyPair, byte[] preSharedKey) Constructs a new Noise handshake builder for the initiator in an IXpsk2 handshake.static NoiseHandshakeBuilder
forIXPsk2Responder
(KeyPair localStaticKeyPair, byte[] preSharedKey) Constructs a new Noise handshake builder for the responder in an IXpsk2 handshake.static NoiseHandshakeBuilder
forIXResponder
(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the responder in an IX handshake.static NoiseHandshakeBuilder
forK1K1Initiator
(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the initiator in a K1K1 handshake.static NoiseHandshakeBuilder
forK1K1Responder
(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the responder in a K1K1 handshake.static NoiseHandshakeBuilder
forK1KInitiator
(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the initiator in a K1K handshake.static NoiseHandshakeBuilder
forK1KResponder
(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the responder in a K1K handshake.static NoiseHandshakeBuilder
forK1NInitiator
(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the initiator in a K1N handshake.static NoiseHandshakeBuilder
forK1NResponder
(PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the responder in a K1N handshake.static NoiseHandshakeBuilder
forK1X1Initiator
(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the initiator in a K1X1 handshake.static NoiseHandshakeBuilder
forK1X1Responder
(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the responder in a K1X1 handshake.static NoiseHandshakeBuilder
forK1XInitiator
(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the initiator in a K1X handshake.static NoiseHandshakeBuilder
forK1XResponder
(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the responder in a K1X handshake.static NoiseHandshakeBuilder
forKInitiator
(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the initiator in a K handshake.static NoiseHandshakeBuilder
forKK1Initiator
(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the initiator in a KK1 handshake.static NoiseHandshakeBuilder
forKK1Responder
(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the responder in a KK1 handshake.static NoiseHandshakeBuilder
forKKInitiator
(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the initiator in a KK handshake.static NoiseHandshakeBuilder
forKKPsk0Initiator
(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey, byte[] preSharedKey) Constructs a new Noise handshake builder for the initiator in a KKpsk0 handshake.static NoiseHandshakeBuilder
forKKPsk0Responder
(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey, byte[] preSharedKey) Constructs a new Noise handshake builder for the responder in a KKpsk0 handshake.static NoiseHandshakeBuilder
forKKPsk2Initiator
(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey, byte[] preSharedKey) Constructs a new Noise handshake builder for the initiator in a KKpsk2 handshake.static NoiseHandshakeBuilder
forKKPsk2Responder
(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey, byte[] preSharedKey) Constructs a new Noise handshake builder for the responder in a KKpsk2 handshake.static NoiseHandshakeBuilder
forKKResponder
(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the responder in a KK handshake.static NoiseHandshakeBuilder
forKNInitiator
(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the initiator in a KN handshake.static NoiseHandshakeBuilder
forKNPsk0Initiator
(KeyPair localStaticKeyPair, byte[] preSharedKey) Constructs a new Noise handshake builder for the initiator in a KNpsk0 handshake.static NoiseHandshakeBuilder
forKNPsk0Responder
(PublicKey remoteStaticPublicKey, byte[] preSharedKey) Constructs a new Noise handshake builder for the responder in a KNpsk0 handshake.static NoiseHandshakeBuilder
forKNPsk2Initiator
(KeyPair localStaticKeyPair, byte[] preSharedKey) Constructs a new Noise handshake builder for the initiator in a KNpsk2 handshake.static NoiseHandshakeBuilder
forKNPsk2Responder
(PublicKey remoteStaticPublicKey, byte[] preSharedKey) Constructs a new Noise handshake builder for the responder in a KNpsk2 handshake.static NoiseHandshakeBuilder
forKNResponder
(PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the responder in a KN handshake.static NoiseHandshakeBuilder
forKPsk0Initiator
(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey, byte[] preSharedKey) Constructs a new Noise handshake builder for the initiator in a Kpsk0 handshake.static NoiseHandshakeBuilder
forKPsk0Responder
(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey, byte[] preSharedKey) Constructs a new Noise handshake builder for the responder in a Kpsk0 handshake.static NoiseHandshakeBuilder
forKResponder
(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the responder in a K handshake.static NoiseHandshakeBuilder
forKX1Initiator
(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the initiator in a KX1 handshake.static NoiseHandshakeBuilder
forKX1Responder
(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the responder in a KX1 handshake.static NoiseHandshakeBuilder
forKXInitiator
(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the initiator in a KX handshake.static NoiseHandshakeBuilder
forKXPsk2Initiator
(KeyPair localStaticKeyPair, byte[] preSharedKey) Constructs a new Noise handshake builder for the initiator in a KXpsk2 handshake.static NoiseHandshakeBuilder
forKXPsk2Responder
(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey, byte[] preSharedKey) Constructs a new Noise handshake builder for the responder in a KXpsk2 handshake.static NoiseHandshakeBuilder
forKXResponder
(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the responder in a KX handshake.static NoiseHandshakeBuilder
forNInitiator
(PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the initiator in an N handshake.static NoiseHandshakeBuilder
forNK1Initiator
(PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the initiator in an NK1 handshake.static NoiseHandshakeBuilder
forNK1Responder
(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the responder in an NK1 handshake.static NoiseHandshakeBuilder
forNKInitiator
(PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the initiator in an NK handshake.static NoiseHandshakeBuilder
forNKPsk0Initiator
(PublicKey remoteStaticPublicKey, byte[] preSharedKey) Constructs a new Noise handshake builder for the initiator in an NKpsk0 handshake.static NoiseHandshakeBuilder
forNKPsk0Responder
(KeyPair localStaticKeyPair, byte[] preSharedKey) Constructs a new Noise handshake builder for the responder in an NKpsk0 handshake.static NoiseHandshakeBuilder
forNKPsk2Initiator
(PublicKey remoteStaticPublicKey, byte[] preSharedKey) Constructs a new Noise handshake builder for the initiator in an NKpsk2 handshake.static NoiseHandshakeBuilder
forNKPsk2Responder
(KeyPair localStaticKeyPair, byte[] preSharedKey) Constructs a new Noise handshake builder for the responder in an NKpsk2 handshake.static NoiseHandshakeBuilder
forNKResponder
(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the responder in an NK handshake.static NoiseHandshakeBuilder
Constructs a new Noise handshake builder for the initiator in an NN handshake.static NoiseHandshakeBuilder
forNNPsk0Initiator
(byte[] preSharedKey) Constructs a new Noise handshake builder for the initiator in an NNpsk0 handshake.static NoiseHandshakeBuilder
forNNPsk0Responder
(byte[] preSharedKey) Constructs a new Noise handshake builder for the responder in an NNpsk0 handshake.static NoiseHandshakeBuilder
forNNPsk2Initiator
(byte[] preSharedKey) Constructs a new Noise handshake builder for the initiator in an NNpsk2 handshake.static NoiseHandshakeBuilder
forNNPsk2Responder
(byte[] preSharedKey) Constructs a new Noise handshake builder for the responder in an NNpsk2 handshake.static NoiseHandshakeBuilder
Constructs a new Noise handshake builder for the responder in an NN handshake.static NoiseHandshakeBuilder
forNPsk0Initiator
(PublicKey remoteStaticPublicKey, byte[] preSharedKey) Constructs a new Noise handshake builder for the initiator in an Npsk0 handshake.static NoiseHandshakeBuilder
forNPsk0Responder
(KeyPair localStaticKeyPair, byte[] preSharedKey) Constructs a new Noise handshake builder for the responder in an Npsk0 handshake.static NoiseHandshakeBuilder
forNResponder
(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the responder in an N handshake.static NoiseHandshakeBuilder
Constructs a new Noise handshake builder for the initiator in an NX1 handshake.static NoiseHandshakeBuilder
forNX1Responder
(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the responder in an NX1 handshake.static NoiseHandshakeBuilder
Constructs a new Noise handshake builder for the initiator in an NX handshake.static NoiseHandshakeBuilder
forNXPsk2Initiator
(byte[] preSharedKey) Constructs a new Noise handshake builder for the initiator in an NXpsk2 handshake.static NoiseHandshakeBuilder
forNXPsk2Responder
(KeyPair localStaticKeyPair, byte[] preSharedKey) Constructs a new Noise handshake builder for the responder in an NXpsk2 handshake.static NoiseHandshakeBuilder
forNXResponder
(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the responder in an NX handshake.static NoiseHandshakeBuilder
forX1K1Initiator
(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the initiator in an X1K1 handshake.static NoiseHandshakeBuilder
forX1K1Responder
(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the responder in an X1K1 handshake.static NoiseHandshakeBuilder
forX1KInitiator
(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the initiator in an X1K handshake.static NoiseHandshakeBuilder
forX1KResponder
(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the responder in an X1K handshake.static NoiseHandshakeBuilder
forX1NInitiator
(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the initiator in an X1N handshake.static NoiseHandshakeBuilder
Constructs a new Noise handshake builder for the responder in an X1N handshake.static NoiseHandshakeBuilder
forX1X1Initiator
(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the initiator in an X1X1 handshake.static NoiseHandshakeBuilder
forX1X1Responder
(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the responder in an X1X1 handshake.static NoiseHandshakeBuilder
forX1XInitiator
(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the initiator in an X1X handshake.static NoiseHandshakeBuilder
forX1XResponder
(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the responder in an X1X handshake.static NoiseHandshakeBuilder
forXInitiator
(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the initiator in an X handshake.static NoiseHandshakeBuilder
forXK1Initiator
(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the initiator in an XK1 handshake.static NoiseHandshakeBuilder
forXK1Responder
(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the responder in an XK1 handshake.static NoiseHandshakeBuilder
forXKInitiator
(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the initiator in an XK handshake.static NoiseHandshakeBuilder
forXKPsk3Initiator
(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey, byte[] preSharedKey) Constructs a new Noise handshake builder for the initiator in an XKpsk3 handshake.static NoiseHandshakeBuilder
forXKPsk3Responder
(KeyPair localStaticKeyPair, byte[] preSharedKey) Constructs a new Noise handshake builder for the responder in an XKpsk3 handshake.static NoiseHandshakeBuilder
forXKResponder
(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the responder in an XK handshake.static NoiseHandshakeBuilder
forXNInitiator
(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the initiator in an XN handshake.static NoiseHandshakeBuilder
forXNPsk3Initiator
(KeyPair localStaticKeyPair, byte[] preSharedKey) Constructs a new Noise handshake builder for the initiator in an XNpsk3 handshake.static NoiseHandshakeBuilder
forXNPsk3Responder
(byte[] preSharedKey) Constructs a new Noise handshake builder for the responder in an XNpsk3 handshake.static NoiseHandshakeBuilder
Constructs a new Noise handshake builder for the responder in an XN handshake.static NoiseHandshakeBuilder
forXPsk1Initiator
(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey, byte[] preSharedKey) Constructs a new Noise handshake builder for the initiator in an Xpsk1 handshake.static NoiseHandshakeBuilder
forXPsk1Responder
(KeyPair localStaticKeyPair, byte[] preSharedKey) Constructs a new Noise handshake builder for the responder in an Xpsk1 handshake.static NoiseHandshakeBuilder
forXResponder
(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the responder in an X handshake.static NoiseHandshakeBuilder
forXX1Initiator
(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the initiator in an XX1 handshake.static NoiseHandshakeBuilder
forXX1Responder
(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the responder in an XX1 handshake.static NoiseHandshakeBuilder
forXXInitiator
(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the initiator in an XX handshake.static NoiseHandshakeBuilder
forXXPsk3Initiator
(KeyPair localStaticKeyPair, byte[] preSharedKey) Constructs a new Noise handshake builder for the initiator in an XXpsk3 handshake.static NoiseHandshakeBuilder
forXXPsk3Responder
(KeyPair localStaticKeyPair, byte[] preSharedKey) Constructs a new Noise handshake builder for the responder in an XXpsk3 handshake.static NoiseHandshakeBuilder
forXXResponder
(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the responder in an XX handshake.Sets the cipher to be used by this handshake.setComponentsFromProtocolName
(String protocolName) Sets the cryptographic components (key agreement, cipher, and hash algorithms) for this handshake from a full Noise protocol name.Sets the hash algorithm to be used by this handshake.setKeyAgreement
(String keyAgreementName) Sets the key agreement algorithm to be used by this handshake.setPrologue
(byte[] prologue) Sets the prologue for this handshake.
-
Method Details
-
setPrologue
Sets the prologue for this handshake.- Parameters:
prologue
- the prologue for this handshake; may benull
- Returns:
- a reference to this handshake builder
-
setComponentsFromProtocolName
public NoiseHandshakeBuilder setComponentsFromProtocolName(String protocolName) throws NoSuchAlgorithmException Sets the cryptographic components (key agreement, cipher, and hash algorithms) for this handshake from a full Noise protocol name.- Parameters:
protocolName
- the Noise protocol name from which to choose cryptographic components for this handshake- Returns:
- a reference to this handshake builder
- Throws:
NoSuchAlgorithmException
- if one or more of the components in the given protocol name is not supported by the current JVMIllegalArgumentException
- if the given protocol name is not a valid Noise protocol name or if its handshake pattern does not match the handshake pattern selected for this handshake- See Also:
-
setCipher
Sets the cipher to be used by this handshake.- Parameters:
cipherName
- the name of the Noise cipher to be used by this handshake- Returns:
- a reference to this handshake builder
- Throws:
NoSuchAlgorithmException
- if the named algorithm is not supported by the current JVMIllegalArgumentException
- if the given name is not recognized as a Noise cipher name- See Also:
-
setHash
Sets the hash algorithm to be used by this handshake.- Parameters:
hashName
- the name of the Noise hash to be used by this handshake- Returns:
- a reference to this handshake builder
- Throws:
NoSuchAlgorithmException
- if the named algorithm is not supported by the current JVMIllegalArgumentException
- if the given name is not recognized as a Noise hash name- See Also:
-
setKeyAgreement
public NoiseHandshakeBuilder setKeyAgreement(String keyAgreementName) throws NoSuchAlgorithmException Sets the key agreement algorithm to be used by this handshake.- Parameters:
keyAgreementName
- the name of the Noise key agreement to be used by this handshake- Returns:
- a reference to this handshake builder
- Throws:
NoSuchAlgorithmException
- if the named algorithm is not supported by the current JVMIllegalArgumentException
- if the given name is not recognized as a Noise key agreement algorithm name- See Also:
-
build
Constructs a Noise handshake with the previously-specified handshake pattern, role key material and cryptographic components.- Returns:
- a Noise handshake instance with the previously-specified handshake pattern, role key material and cryptographic components
- Throws:
IllegalStateException
- if one or more cryptographic components has not been specified- See Also:
-
forNInitiator
Constructs a new Noise handshake builder for the initiator in an N handshake.- Parameters:
remoteStaticPublicKey
- the remote static public key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forNResponder
Constructs a new Noise handshake builder for the responder in an N handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forKInitiator
public static NoiseHandshakeBuilder forKInitiator(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the initiator in a K handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
remoteStaticPublicKey
- the remote static public key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forKResponder
public static NoiseHandshakeBuilder forKResponder(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the responder in a K handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
remoteStaticPublicKey
- the remote static public key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forXInitiator
public static NoiseHandshakeBuilder forXInitiator(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the initiator in an X handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
remoteStaticPublicKey
- the remote static public key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forXResponder
Constructs a new Noise handshake builder for the responder in an X handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forNNInitiator
Constructs a new Noise handshake builder for the initiator in an NN handshake.- Returns:
- a new Noise handshake builder
-
forNNResponder
Constructs a new Noise handshake builder for the responder in an NN handshake.- Returns:
- a new Noise handshake builder
-
forKNInitiator
Constructs a new Noise handshake builder for the initiator in a KN handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forKNResponder
Constructs a new Noise handshake builder for the responder in a KN handshake.- Parameters:
remoteStaticPublicKey
- the remote static public key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forNKInitiator
Constructs a new Noise handshake builder for the initiator in an NK handshake.- Parameters:
remoteStaticPublicKey
- the remote static public key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forNKResponder
Constructs a new Noise handshake builder for the responder in an NK handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forKKInitiator
public static NoiseHandshakeBuilder forKKInitiator(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the initiator in a KK handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
remoteStaticPublicKey
- the remote static public key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forKKResponder
public static NoiseHandshakeBuilder forKKResponder(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the responder in a KK handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
remoteStaticPublicKey
- the remote static public key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forNXInitiator
Constructs a new Noise handshake builder for the initiator in an NX handshake.- Returns:
- a new Noise handshake builder
-
forNXResponder
Constructs a new Noise handshake builder for the responder in an NX handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forKXInitiator
Constructs a new Noise handshake builder for the initiator in a KX handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forKXResponder
public static NoiseHandshakeBuilder forKXResponder(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the responder in a KX handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
remoteStaticPublicKey
- the remote static public key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forXNInitiator
Constructs a new Noise handshake builder for the initiator in an XN handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forXNResponder
Constructs a new Noise handshake builder for the responder in an XN handshake.- Returns:
- a new Noise handshake builder
-
forINInitiator
Constructs a new Noise handshake builder for the initiator in an IN handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forINResponder
Constructs a new Noise handshake builder for the responder in an IN handshake.- Returns:
- a new Noise handshake builder
-
forXKInitiator
public static NoiseHandshakeBuilder forXKInitiator(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the initiator in an XK handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
remoteStaticPublicKey
- the remote static public key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forXKResponder
Constructs a new Noise handshake builder for the responder in an XK handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forIKInitiator
public static NoiseHandshakeBuilder forIKInitiator(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the initiator in an IK handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
remoteStaticPublicKey
- the remote static public key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forIKResponder
Constructs a new Noise handshake builder for the responder in an IK handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forXXInitiator
Constructs a new Noise handshake builder for the initiator in an XX handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forXXResponder
Constructs a new Noise handshake builder for the responder in an XX handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forIXInitiator
Constructs a new Noise handshake builder for the initiator in an IX handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forIXResponder
Constructs a new Noise handshake builder for the responder in an IX handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forNK1Initiator
Constructs a new Noise handshake builder for the initiator in an NK1 handshake.- Parameters:
remoteStaticPublicKey
- the remote static public key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forNK1Responder
Constructs a new Noise handshake builder for the responder in an NK1 handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forNX1Initiator
Constructs a new Noise handshake builder for the initiator in an NX1 handshake.- Returns:
- a new Noise handshake builder
-
forNX1Responder
Constructs a new Noise handshake builder for the responder in an NX1 handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forX1NInitiator
Constructs a new Noise handshake builder for the initiator in an X1N handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forX1NResponder
Constructs a new Noise handshake builder for the responder in an X1N handshake.- Returns:
- a new Noise handshake builder
-
forX1KInitiator
public static NoiseHandshakeBuilder forX1KInitiator(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the initiator in an X1K handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
remoteStaticPublicKey
- the remote static public key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forX1KResponder
Constructs a new Noise handshake builder for the responder in an X1K handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forXK1Initiator
public static NoiseHandshakeBuilder forXK1Initiator(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the initiator in an XK1 handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
remoteStaticPublicKey
- the remote static public key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forXK1Responder
Constructs a new Noise handshake builder for the responder in an XK1 handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forX1K1Initiator
public static NoiseHandshakeBuilder forX1K1Initiator(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the initiator in an X1K1 handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
remoteStaticPublicKey
- the remote static public key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forX1K1Responder
Constructs a new Noise handshake builder for the responder in an X1K1 handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forX1XInitiator
Constructs a new Noise handshake builder for the initiator in an X1X handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forX1XResponder
Constructs a new Noise handshake builder for the responder in an X1X handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forXX1Initiator
Constructs a new Noise handshake builder for the initiator in an XX1 handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forXX1Responder
Constructs a new Noise handshake builder for the responder in an XX1 handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forX1X1Initiator
Constructs a new Noise handshake builder for the initiator in an X1X1 handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forX1X1Responder
Constructs a new Noise handshake builder for the responder in an X1X1 handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forK1NInitiator
Constructs a new Noise handshake builder for the initiator in a K1N handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forK1NResponder
Constructs a new Noise handshake builder for the responder in a K1N handshake.- Parameters:
remoteStaticPublicKey
- the remote static public key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forK1KInitiator
public static NoiseHandshakeBuilder forK1KInitiator(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the initiator in a K1K handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
remoteStaticPublicKey
- the remote static public key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forK1KResponder
public static NoiseHandshakeBuilder forK1KResponder(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the responder in a K1K handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
remoteStaticPublicKey
- the remote static public key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forKK1Initiator
public static NoiseHandshakeBuilder forKK1Initiator(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the initiator in a KK1 handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
remoteStaticPublicKey
- the remote static public key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forKK1Responder
public static NoiseHandshakeBuilder forKK1Responder(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the responder in a KK1 handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
remoteStaticPublicKey
- the remote static public key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forK1K1Initiator
public static NoiseHandshakeBuilder forK1K1Initiator(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the initiator in a K1K1 handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
remoteStaticPublicKey
- the remote static public key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forK1K1Responder
public static NoiseHandshakeBuilder forK1K1Responder(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the responder in a K1K1 handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
remoteStaticPublicKey
- the remote static public key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forK1XInitiator
Constructs a new Noise handshake builder for the initiator in a K1X handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forK1XResponder
public static NoiseHandshakeBuilder forK1XResponder(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the responder in a K1X handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
remoteStaticPublicKey
- the remote static public key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forKX1Initiator
Constructs a new Noise handshake builder for the initiator in a KX1 handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forKX1Responder
public static NoiseHandshakeBuilder forKX1Responder(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the responder in a KX1 handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
remoteStaticPublicKey
- the remote static public key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forK1X1Initiator
Constructs a new Noise handshake builder for the initiator in a K1X1 handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forK1X1Responder
public static NoiseHandshakeBuilder forK1X1Responder(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the responder in a K1X1 handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
remoteStaticPublicKey
- the remote static public key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forI1NInitiator
Constructs a new Noise handshake builder for the initiator in an I1N handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forI1NResponder
Constructs a new Noise handshake builder for the responder in an I1N handshake.- Returns:
- a new Noise handshake builder
-
forI1KInitiator
public static NoiseHandshakeBuilder forI1KInitiator(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the initiator in an I1K handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
remoteStaticPublicKey
- the remote static public key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forI1KResponder
Constructs a new Noise handshake builder for the responder in an I1K handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forIK1Initiator
public static NoiseHandshakeBuilder forIK1Initiator(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the initiator in an IK1 handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
remoteStaticPublicKey
- the remote static public key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forIK1Responder
Constructs a new Noise handshake builder for the responder in an IK1 handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forI1K1Initiator
public static NoiseHandshakeBuilder forI1K1Initiator(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the initiator in an I1K1 handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
remoteStaticPublicKey
- the remote static public key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forI1K1Responder
Constructs a new Noise handshake builder for the responder in an I1K1 handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forI1XInitiator
Constructs a new Noise handshake builder for the initiator in an I1X handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forI1XResponder
Constructs a new Noise handshake builder for the responder in an I1X handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forIX1Initiator
Constructs a new Noise handshake builder for the initiator in an IX1 handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forIX1Responder
Constructs a new Noise handshake builder for the responder in an IX1 handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forI1X1Initiator
Constructs a new Noise handshake builder for the initiator in an I1X1 handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forI1X1Responder
Constructs a new Noise handshake builder for the responder in an I1X1 handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
-
forNPsk0Initiator
public static NoiseHandshakeBuilder forNPsk0Initiator(PublicKey remoteStaticPublicKey, byte[] preSharedKey) Constructs a new Noise handshake builder for the initiator in an Npsk0 handshake.- Parameters:
remoteStaticPublicKey
- the remote static public key for this handshake; must not benull
preSharedKey
- the pre-shared key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
IllegalArgumentException
- if the given pre-shared key is not exactly 32 bytes long
-
forNPsk0Responder
public static NoiseHandshakeBuilder forNPsk0Responder(KeyPair localStaticKeyPair, byte[] preSharedKey) Constructs a new Noise handshake builder for the responder in an Npsk0 handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
preSharedKey
- the pre-shared key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
IllegalArgumentException
- if the given pre-shared key is not exactly 32 bytes long
-
forKPsk0Initiator
public static NoiseHandshakeBuilder forKPsk0Initiator(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey, byte[] preSharedKey) Constructs a new Noise handshake builder for the initiator in a Kpsk0 handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
remoteStaticPublicKey
- the remote static public key for this handshake; must not benull
preSharedKey
- the pre-shared key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
IllegalArgumentException
- if the given pre-shared key is not exactly 32 bytes long
-
forKPsk0Responder
public static NoiseHandshakeBuilder forKPsk0Responder(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey, byte[] preSharedKey) Constructs a new Noise handshake builder for the responder in a Kpsk0 handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
remoteStaticPublicKey
- the remote static public key for this handshake; must not benull
preSharedKey
- the pre-shared key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
IllegalArgumentException
- if the given pre-shared key is not exactly 32 bytes long
-
forXPsk1Initiator
public static NoiseHandshakeBuilder forXPsk1Initiator(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey, byte[] preSharedKey) Constructs a new Noise handshake builder for the initiator in an Xpsk1 handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
remoteStaticPublicKey
- the remote static public key for this handshake; must not benull
preSharedKey
- the pre-shared key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
IllegalArgumentException
- if the given pre-shared key is not exactly 32 bytes long
-
forXPsk1Responder
public static NoiseHandshakeBuilder forXPsk1Responder(KeyPair localStaticKeyPair, byte[] preSharedKey) Constructs a new Noise handshake builder for the responder in an Xpsk1 handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
preSharedKey
- the pre-shared key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
IllegalArgumentException
- if the given pre-shared key is not exactly 32 bytes long
-
forNNPsk0Initiator
Constructs a new Noise handshake builder for the initiator in an NNpsk0 handshake.- Parameters:
preSharedKey
- the pre-shared key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
IllegalArgumentException
- if the given pre-shared key is not exactly 32 bytes long
-
forNNPsk0Responder
Constructs a new Noise handshake builder for the responder in an NNpsk0 handshake.- Parameters:
preSharedKey
- the pre-shared key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
IllegalArgumentException
- if the given pre-shared key is not exactly 32 bytes long
-
forNNPsk2Initiator
Constructs a new Noise handshake builder for the initiator in an NNpsk2 handshake.- Parameters:
preSharedKey
- the pre-shared key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
IllegalArgumentException
- if the given pre-shared key is not exactly 32 bytes long
-
forNNPsk2Responder
Constructs a new Noise handshake builder for the responder in an NNpsk2 handshake.- Parameters:
preSharedKey
- the pre-shared key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
IllegalArgumentException
- if the given pre-shared key is not exactly 32 bytes long
-
forNKPsk0Initiator
public static NoiseHandshakeBuilder forNKPsk0Initiator(PublicKey remoteStaticPublicKey, byte[] preSharedKey) Constructs a new Noise handshake builder for the initiator in an NKpsk0 handshake.- Parameters:
remoteStaticPublicKey
- the remote static public key for this handshake; must not benull
preSharedKey
- the pre-shared key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
IllegalArgumentException
- if the given pre-shared key is not exactly 32 bytes long
-
forNKPsk0Responder
public static NoiseHandshakeBuilder forNKPsk0Responder(KeyPair localStaticKeyPair, byte[] preSharedKey) Constructs a new Noise handshake builder for the responder in an NKpsk0 handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
preSharedKey
- the pre-shared key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
IllegalArgumentException
- if the given pre-shared key is not exactly 32 bytes long
-
forNKPsk2Initiator
public static NoiseHandshakeBuilder forNKPsk2Initiator(PublicKey remoteStaticPublicKey, byte[] preSharedKey) Constructs a new Noise handshake builder for the initiator in an NKpsk2 handshake.- Parameters:
remoteStaticPublicKey
- the remote static public key for this handshake; must not benull
preSharedKey
- the pre-shared key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
IllegalArgumentException
- if the given pre-shared key is not exactly 32 bytes long
-
forNKPsk2Responder
public static NoiseHandshakeBuilder forNKPsk2Responder(KeyPair localStaticKeyPair, byte[] preSharedKey) Constructs a new Noise handshake builder for the responder in an NKpsk2 handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
preSharedKey
- the pre-shared key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
IllegalArgumentException
- if the given pre-shared key is not exactly 32 bytes long
-
forNXPsk2Initiator
Constructs a new Noise handshake builder for the initiator in an NXpsk2 handshake.- Parameters:
preSharedKey
- the pre-shared key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
IllegalArgumentException
- if the given pre-shared key is not exactly 32 bytes long
-
forNXPsk2Responder
public static NoiseHandshakeBuilder forNXPsk2Responder(KeyPair localStaticKeyPair, byte[] preSharedKey) Constructs a new Noise handshake builder for the responder in an NXpsk2 handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
preSharedKey
- the pre-shared key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
IllegalArgumentException
- if the given pre-shared key is not exactly 32 bytes long
-
forXNPsk3Initiator
public static NoiseHandshakeBuilder forXNPsk3Initiator(KeyPair localStaticKeyPair, byte[] preSharedKey) Constructs a new Noise handshake builder for the initiator in an XNpsk3 handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
preSharedKey
- the pre-shared key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
IllegalArgumentException
- if the given pre-shared key is not exactly 32 bytes long
-
forXNPsk3Responder
Constructs a new Noise handshake builder for the responder in an XNpsk3 handshake.- Parameters:
preSharedKey
- the pre-shared key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
IllegalArgumentException
- if the given pre-shared key is not exactly 32 bytes long
-
forXKPsk3Initiator
public static NoiseHandshakeBuilder forXKPsk3Initiator(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey, byte[] preSharedKey) Constructs a new Noise handshake builder for the initiator in an XKpsk3 handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
remoteStaticPublicKey
- the remote static public key for this handshake; must not benull
preSharedKey
- the pre-shared key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
IllegalArgumentException
- if the given pre-shared key is not exactly 32 bytes long
-
forXKPsk3Responder
public static NoiseHandshakeBuilder forXKPsk3Responder(KeyPair localStaticKeyPair, byte[] preSharedKey) Constructs a new Noise handshake builder for the responder in an XKpsk3 handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
preSharedKey
- the pre-shared key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
IllegalArgumentException
- if the given pre-shared key is not exactly 32 bytes long
-
forXXPsk3Initiator
public static NoiseHandshakeBuilder forXXPsk3Initiator(KeyPair localStaticKeyPair, byte[] preSharedKey) Constructs a new Noise handshake builder for the initiator in an XXpsk3 handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
preSharedKey
- the pre-shared key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
IllegalArgumentException
- if the given pre-shared key is not exactly 32 bytes long
-
forXXPsk3Responder
public static NoiseHandshakeBuilder forXXPsk3Responder(KeyPair localStaticKeyPair, byte[] preSharedKey) Constructs a new Noise handshake builder for the responder in an XXpsk3 handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
preSharedKey
- the pre-shared key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
IllegalArgumentException
- if the given pre-shared key is not exactly 32 bytes long
-
forKNPsk0Initiator
public static NoiseHandshakeBuilder forKNPsk0Initiator(KeyPair localStaticKeyPair, byte[] preSharedKey) Constructs a new Noise handshake builder for the initiator in a KNpsk0 handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
preSharedKey
- the pre-shared key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
IllegalArgumentException
- if the given pre-shared key is not exactly 32 bytes long
-
forKNPsk0Responder
public static NoiseHandshakeBuilder forKNPsk0Responder(PublicKey remoteStaticPublicKey, byte[] preSharedKey) Constructs a new Noise handshake builder for the responder in a KNpsk0 handshake.- Parameters:
remoteStaticPublicKey
- the remote static public key for this handshake; must not benull
preSharedKey
- the pre-shared key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
IllegalArgumentException
- if the given pre-shared key is not exactly 32 bytes long
-
forKNPsk2Initiator
public static NoiseHandshakeBuilder forKNPsk2Initiator(KeyPair localStaticKeyPair, byte[] preSharedKey) Constructs a new Noise handshake builder for the initiator in a KNpsk2 handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
preSharedKey
- the pre-shared key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
IllegalArgumentException
- if the given pre-shared key is not exactly 32 bytes long
-
forKNPsk2Responder
public static NoiseHandshakeBuilder forKNPsk2Responder(PublicKey remoteStaticPublicKey, byte[] preSharedKey) Constructs a new Noise handshake builder for the responder in a KNpsk2 handshake.- Parameters:
remoteStaticPublicKey
- the remote static public key for this handshake; must not benull
preSharedKey
- the pre-shared key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
IllegalArgumentException
- if the given pre-shared key is not exactly 32 bytes long
-
forKKPsk0Initiator
public static NoiseHandshakeBuilder forKKPsk0Initiator(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey, byte[] preSharedKey) Constructs a new Noise handshake builder for the initiator in a KKpsk0 handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
remoteStaticPublicKey
- the remote static public key for this handshake; must not benull
preSharedKey
- the pre-shared key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
IllegalArgumentException
- if the given pre-shared key is not exactly 32 bytes long
-
forKKPsk0Responder
public static NoiseHandshakeBuilder forKKPsk0Responder(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey, byte[] preSharedKey) Constructs a new Noise handshake builder for the responder in a KKpsk0 handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
remoteStaticPublicKey
- the remote static public key for this handshake; must not benull
preSharedKey
- the pre-shared key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
IllegalArgumentException
- if the given pre-shared key is not exactly 32 bytes long
-
forKKPsk2Initiator
public static NoiseHandshakeBuilder forKKPsk2Initiator(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey, byte[] preSharedKey) Constructs a new Noise handshake builder for the initiator in a KKpsk2 handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
remoteStaticPublicKey
- the remote static public key for this handshake; must not benull
preSharedKey
- the pre-shared key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
IllegalArgumentException
- if the given pre-shared key is not exactly 32 bytes long
-
forKKPsk2Responder
public static NoiseHandshakeBuilder forKKPsk2Responder(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey, byte[] preSharedKey) Constructs a new Noise handshake builder for the responder in a KKpsk2 handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
remoteStaticPublicKey
- the remote static public key for this handshake; must not benull
preSharedKey
- the pre-shared key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
IllegalArgumentException
- if the given pre-shared key is not exactly 32 bytes long
-
forKXPsk2Initiator
public static NoiseHandshakeBuilder forKXPsk2Initiator(KeyPair localStaticKeyPair, byte[] preSharedKey) Constructs a new Noise handshake builder for the initiator in a KXpsk2 handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
preSharedKey
- the pre-shared key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
IllegalArgumentException
- if the given pre-shared key is not exactly 32 bytes long
-
forKXPsk2Responder
public static NoiseHandshakeBuilder forKXPsk2Responder(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey, byte[] preSharedKey) Constructs a new Noise handshake builder for the responder in a KXpsk2 handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
remoteStaticPublicKey
- the remote static public key for this handshake; must not benull
preSharedKey
- the pre-shared key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
IllegalArgumentException
- if the given pre-shared key is not exactly 32 bytes long
-
forINPsk1Initiator
public static NoiseHandshakeBuilder forINPsk1Initiator(KeyPair localStaticKeyPair, byte[] preSharedKey) Constructs a new Noise handshake builder for the initiator in an INpsk1 handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
preSharedKey
- the pre-shared key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
IllegalArgumentException
- if the given pre-shared key is not exactly 32 bytes long
-
forINPsk1Responder
Constructs a new Noise handshake builder for the responder in an INpsk1 handshake.- Parameters:
preSharedKey
- the pre-shared key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
IllegalArgumentException
- if the given pre-shared key is not exactly 32 bytes long
-
forINPsk2Initiator
public static NoiseHandshakeBuilder forINPsk2Initiator(KeyPair localStaticKeyPair, byte[] preSharedKey) Constructs a new Noise handshake builder for the initiator in an INpsk2 handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
preSharedKey
- the pre-shared key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
IllegalArgumentException
- if the given pre-shared key is not exactly 32 bytes long
-
forINPsk2Responder
Constructs a new Noise handshake builder for the responder in an INpsk2 handshake.- Parameters:
preSharedKey
- the pre-shared key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
IllegalArgumentException
- if the given pre-shared key is not exactly 32 bytes long
-
forIKPsk1Initiator
public static NoiseHandshakeBuilder forIKPsk1Initiator(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey, byte[] preSharedKey) Constructs a new Noise handshake builder for the initiator in an IKpsk1 handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
remoteStaticPublicKey
- the remote static public key for this handshake; must not benull
preSharedKey
- the pre-shared key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
IllegalArgumentException
- if the given pre-shared key is not exactly 32 bytes long
-
forIKPsk1Responder
public static NoiseHandshakeBuilder forIKPsk1Responder(KeyPair localStaticKeyPair, byte[] preSharedKey) Constructs a new Noise handshake builder for the responder in an IKpsk1 handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
preSharedKey
- the pre-shared key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
IllegalArgumentException
- if the given pre-shared key is not exactly 32 bytes long
-
forIKPsk2Initiator
public static NoiseHandshakeBuilder forIKPsk2Initiator(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey, byte[] preSharedKey) Constructs a new Noise handshake builder for the initiator in an IKpsk2 handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
remoteStaticPublicKey
- the remote static public key for this handshake; must not benull
preSharedKey
- the pre-shared key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
IllegalArgumentException
- if the given pre-shared key is not exactly 32 bytes long
-
forIKPsk2Responder
public static NoiseHandshakeBuilder forIKPsk2Responder(KeyPair localStaticKeyPair, byte[] preSharedKey) Constructs a new Noise handshake builder for the responder in an IKpsk2 handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
preSharedKey
- the pre-shared key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
IllegalArgumentException
- if the given pre-shared key is not exactly 32 bytes long
-
forIXPsk2Initiator
public static NoiseHandshakeBuilder forIXPsk2Initiator(KeyPair localStaticKeyPair, byte[] preSharedKey) Constructs a new Noise handshake builder for the initiator in an IXpsk2 handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
preSharedKey
- the pre-shared key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
IllegalArgumentException
- if the given pre-shared key is not exactly 32 bytes long
-
forIXPsk2Responder
public static NoiseHandshakeBuilder forIXPsk2Responder(KeyPair localStaticKeyPair, byte[] preSharedKey) Constructs a new Noise handshake builder for the responder in an IXpsk2 handshake.- Parameters:
localStaticKeyPair
- the local static key pair for this handshake; must not benull
preSharedKey
- the pre-shared key for this handshake; must not benull
- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException
- if any required keynull
IllegalArgumentException
- if the given pre-shared key is not exactly 32 bytes long
-