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 NoiseHandshakeBuilderforI1K1Initiator(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the initiator in an I1K1 handshake.static NoiseHandshakeBuilderforI1K1Responder(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the responder in an I1K1 handshake.static NoiseHandshakeBuilderforI1KInitiator(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the initiator in an I1K handshake.static NoiseHandshakeBuilderforI1KResponder(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the responder in an I1K handshake.static NoiseHandshakeBuilderforI1NInitiator(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the initiator in an I1N handshake.static NoiseHandshakeBuilderConstructs a new Noise handshake builder for the responder in an I1N handshake.static NoiseHandshakeBuilderforI1X1Initiator(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the initiator in an I1X1 handshake.static NoiseHandshakeBuilderforI1X1Responder(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the responder in an I1X1 handshake.static NoiseHandshakeBuilderforI1XInitiator(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the initiator in an I1X handshake.static NoiseHandshakeBuilderforI1XResponder(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the responder in an I1X handshake.static NoiseHandshakeBuilderforIK1Initiator(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the initiator in an IK1 handshake.static NoiseHandshakeBuilderforIK1Responder(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the responder in an IK1 handshake.static NoiseHandshakeBuilderforIKInitiator(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the initiator in an IK handshake.static NoiseHandshakeBuilderforIKPsk1Initiator(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey, byte[] preSharedKey) Constructs a new Noise handshake builder for the initiator in an IKpsk1 handshake.static NoiseHandshakeBuilderforIKPsk1Responder(KeyPair localStaticKeyPair, byte[] preSharedKey) Constructs a new Noise handshake builder for the responder in an IKpsk1 handshake.static NoiseHandshakeBuilderforIKPsk2Initiator(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey, byte[] preSharedKey) Constructs a new Noise handshake builder for the initiator in an IKpsk2 handshake.static NoiseHandshakeBuilderforIKPsk2Responder(KeyPair localStaticKeyPair, byte[] preSharedKey) Constructs a new Noise handshake builder for the responder in an IKpsk2 handshake.static NoiseHandshakeBuilderforIKResponder(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the responder in an IK handshake.static NoiseHandshakeBuilderforINInitiator(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the initiator in an IN handshake.static NoiseHandshakeBuilderforINPsk1Initiator(KeyPair localStaticKeyPair, byte[] preSharedKey) Constructs a new Noise handshake builder for the initiator in an INpsk1 handshake.static NoiseHandshakeBuilderforINPsk1Responder(byte[] preSharedKey) Constructs a new Noise handshake builder for the responder in an INpsk1 handshake.static NoiseHandshakeBuilderforINPsk2Initiator(KeyPair localStaticKeyPair, byte[] preSharedKey) Constructs a new Noise handshake builder for the initiator in an INpsk2 handshake.static NoiseHandshakeBuilderforINPsk2Responder(byte[] preSharedKey) Constructs a new Noise handshake builder for the responder in an INpsk2 handshake.static NoiseHandshakeBuilderConstructs a new Noise handshake builder for the responder in an IN handshake.static NoiseHandshakeBuilderforIX1Initiator(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the initiator in an IX1 handshake.static NoiseHandshakeBuilderforIX1Responder(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the responder in an IX1 handshake.static NoiseHandshakeBuilderforIXInitiator(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the initiator in an IX handshake.static NoiseHandshakeBuilderforIXPsk2Initiator(KeyPair localStaticKeyPair, byte[] preSharedKey) Constructs a new Noise handshake builder for the initiator in an IXpsk2 handshake.static NoiseHandshakeBuilderforIXPsk2Responder(KeyPair localStaticKeyPair, byte[] preSharedKey) Constructs a new Noise handshake builder for the responder in an IXpsk2 handshake.static NoiseHandshakeBuilderforIXResponder(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the responder in an IX handshake.static NoiseHandshakeBuilderforK1K1Initiator(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the initiator in a K1K1 handshake.static NoiseHandshakeBuilderforK1K1Responder(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the responder in a K1K1 handshake.static NoiseHandshakeBuilderforK1KInitiator(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the initiator in a K1K handshake.static NoiseHandshakeBuilderforK1KResponder(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the responder in a K1K handshake.static NoiseHandshakeBuilderforK1NInitiator(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the initiator in a K1N handshake.static NoiseHandshakeBuilderforK1NResponder(PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the responder in a K1N handshake.static NoiseHandshakeBuilderforK1X1Initiator(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the initiator in a K1X1 handshake.static NoiseHandshakeBuilderforK1X1Responder(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the responder in a K1X1 handshake.static NoiseHandshakeBuilderforK1XInitiator(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the initiator in a K1X handshake.static NoiseHandshakeBuilderforK1XResponder(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the responder in a K1X handshake.static NoiseHandshakeBuilderforKInitiator(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the initiator in a K handshake.static NoiseHandshakeBuilderforKK1Initiator(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the initiator in a KK1 handshake.static NoiseHandshakeBuilderforKK1Responder(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the responder in a KK1 handshake.static NoiseHandshakeBuilderforKKInitiator(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the initiator in a KK handshake.static NoiseHandshakeBuilderforKKPsk0Initiator(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey, byte[] preSharedKey) Constructs a new Noise handshake builder for the initiator in a KKpsk0 handshake.static NoiseHandshakeBuilderforKKPsk0Responder(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey, byte[] preSharedKey) Constructs a new Noise handshake builder for the responder in a KKpsk0 handshake.static NoiseHandshakeBuilderforKKPsk2Initiator(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey, byte[] preSharedKey) Constructs a new Noise handshake builder for the initiator in a KKpsk2 handshake.static NoiseHandshakeBuilderforKKPsk2Responder(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey, byte[] preSharedKey) Constructs a new Noise handshake builder for the responder in a KKpsk2 handshake.static NoiseHandshakeBuilderforKKResponder(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the responder in a KK handshake.static NoiseHandshakeBuilderforKNInitiator(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the initiator in a KN handshake.static NoiseHandshakeBuilderforKNPsk0Initiator(KeyPair localStaticKeyPair, byte[] preSharedKey) Constructs a new Noise handshake builder for the initiator in a KNpsk0 handshake.static NoiseHandshakeBuilderforKNPsk0Responder(PublicKey remoteStaticPublicKey, byte[] preSharedKey) Constructs a new Noise handshake builder for the responder in a KNpsk0 handshake.static NoiseHandshakeBuilderforKNPsk2Initiator(KeyPair localStaticKeyPair, byte[] preSharedKey) Constructs a new Noise handshake builder for the initiator in a KNpsk2 handshake.static NoiseHandshakeBuilderforKNPsk2Responder(PublicKey remoteStaticPublicKey, byte[] preSharedKey) Constructs a new Noise handshake builder for the responder in a KNpsk2 handshake.static NoiseHandshakeBuilderforKNResponder(PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the responder in a KN handshake.static NoiseHandshakeBuilderforKPsk0Initiator(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey, byte[] preSharedKey) Constructs a new Noise handshake builder for the initiator in a Kpsk0 handshake.static NoiseHandshakeBuilderforKPsk0Responder(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey, byte[] preSharedKey) Constructs a new Noise handshake builder for the responder in a Kpsk0 handshake.static NoiseHandshakeBuilderforKResponder(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the responder in a K handshake.static NoiseHandshakeBuilderforKX1Initiator(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the initiator in a KX1 handshake.static NoiseHandshakeBuilderforKX1Responder(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the responder in a KX1 handshake.static NoiseHandshakeBuilderforKXInitiator(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the initiator in a KX handshake.static NoiseHandshakeBuilderforKXPsk2Initiator(KeyPair localStaticKeyPair, byte[] preSharedKey) Constructs a new Noise handshake builder for the initiator in a KXpsk2 handshake.static NoiseHandshakeBuilderforKXPsk2Responder(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey, byte[] preSharedKey) Constructs a new Noise handshake builder for the responder in a KXpsk2 handshake.static NoiseHandshakeBuilderforKXResponder(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the responder in a KX handshake.static NoiseHandshakeBuilderforNInitiator(PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the initiator in an N handshake.static NoiseHandshakeBuilderforNK1Initiator(PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the initiator in an NK1 handshake.static NoiseHandshakeBuilderforNK1Responder(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the responder in an NK1 handshake.static NoiseHandshakeBuilderforNKInitiator(PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the initiator in an NK handshake.static NoiseHandshakeBuilderforNKPsk0Initiator(PublicKey remoteStaticPublicKey, byte[] preSharedKey) Constructs a new Noise handshake builder for the initiator in an NKpsk0 handshake.static NoiseHandshakeBuilderforNKPsk0Responder(KeyPair localStaticKeyPair, byte[] preSharedKey) Constructs a new Noise handshake builder for the responder in an NKpsk0 handshake.static NoiseHandshakeBuilderforNKPsk2Initiator(PublicKey remoteStaticPublicKey, byte[] preSharedKey) Constructs a new Noise handshake builder for the initiator in an NKpsk2 handshake.static NoiseHandshakeBuilderforNKPsk2Responder(KeyPair localStaticKeyPair, byte[] preSharedKey) Constructs a new Noise handshake builder for the responder in an NKpsk2 handshake.static NoiseHandshakeBuilderforNKResponder(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the responder in an NK handshake.static NoiseHandshakeBuilderConstructs a new Noise handshake builder for the initiator in an NN handshake.static NoiseHandshakeBuilderforNNPsk0Initiator(byte[] preSharedKey) Constructs a new Noise handshake builder for the initiator in an NNpsk0 handshake.static NoiseHandshakeBuilderforNNPsk0Responder(byte[] preSharedKey) Constructs a new Noise handshake builder for the responder in an NNpsk0 handshake.static NoiseHandshakeBuilderforNNPsk2Initiator(byte[] preSharedKey) Constructs a new Noise handshake builder for the initiator in an NNpsk2 handshake.static NoiseHandshakeBuilderforNNPsk2Responder(byte[] preSharedKey) Constructs a new Noise handshake builder for the responder in an NNpsk2 handshake.static NoiseHandshakeBuilderConstructs a new Noise handshake builder for the responder in an NN handshake.static NoiseHandshakeBuilderforNPsk0Initiator(PublicKey remoteStaticPublicKey, byte[] preSharedKey) Constructs a new Noise handshake builder for the initiator in an Npsk0 handshake.static NoiseHandshakeBuilderforNPsk0Responder(KeyPair localStaticKeyPair, byte[] preSharedKey) Constructs a new Noise handshake builder for the responder in an Npsk0 handshake.static NoiseHandshakeBuilderforNResponder(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the responder in an N handshake.static NoiseHandshakeBuilderConstructs a new Noise handshake builder for the initiator in an NX1 handshake.static NoiseHandshakeBuilderforNX1Responder(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the responder in an NX1 handshake.static NoiseHandshakeBuilderConstructs a new Noise handshake builder for the initiator in an NX handshake.static NoiseHandshakeBuilderforNXPsk2Initiator(byte[] preSharedKey) Constructs a new Noise handshake builder for the initiator in an NXpsk2 handshake.static NoiseHandshakeBuilderforNXPsk2Responder(KeyPair localStaticKeyPair, byte[] preSharedKey) Constructs a new Noise handshake builder for the responder in an NXpsk2 handshake.static NoiseHandshakeBuilderforNXResponder(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the responder in an NX handshake.static NoiseHandshakeBuilderforX1K1Initiator(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the initiator in an X1K1 handshake.static NoiseHandshakeBuilderforX1K1Responder(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the responder in an X1K1 handshake.static NoiseHandshakeBuilderforX1KInitiator(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the initiator in an X1K handshake.static NoiseHandshakeBuilderforX1KResponder(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the responder in an X1K handshake.static NoiseHandshakeBuilderforX1NInitiator(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the initiator in an X1N handshake.static NoiseHandshakeBuilderConstructs a new Noise handshake builder for the responder in an X1N handshake.static NoiseHandshakeBuilderforX1X1Initiator(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the initiator in an X1X1 handshake.static NoiseHandshakeBuilderforX1X1Responder(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the responder in an X1X1 handshake.static NoiseHandshakeBuilderforX1XInitiator(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the initiator in an X1X handshake.static NoiseHandshakeBuilderforX1XResponder(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the responder in an X1X handshake.static NoiseHandshakeBuilderforXInitiator(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the initiator in an X handshake.static NoiseHandshakeBuilderforXK1Initiator(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the initiator in an XK1 handshake.static NoiseHandshakeBuilderforXK1Responder(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the responder in an XK1 handshake.static NoiseHandshakeBuilderforXKInitiator(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey) Constructs a new Noise handshake builder for the initiator in an XK handshake.static NoiseHandshakeBuilderforXKPsk3Initiator(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey, byte[] preSharedKey) Constructs a new Noise handshake builder for the initiator in an XKpsk3 handshake.static NoiseHandshakeBuilderforXKPsk3Responder(KeyPair localStaticKeyPair, byte[] preSharedKey) Constructs a new Noise handshake builder for the responder in an XKpsk3 handshake.static NoiseHandshakeBuilderforXKResponder(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the responder in an XK handshake.static NoiseHandshakeBuilderforXNInitiator(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the initiator in an XN handshake.static NoiseHandshakeBuilderforXNPsk3Initiator(KeyPair localStaticKeyPair, byte[] preSharedKey) Constructs a new Noise handshake builder for the initiator in an XNpsk3 handshake.static NoiseHandshakeBuilderforXNPsk3Responder(byte[] preSharedKey) Constructs a new Noise handshake builder for the responder in an XNpsk3 handshake.static NoiseHandshakeBuilderConstructs a new Noise handshake builder for the responder in an XN handshake.static NoiseHandshakeBuilderforXPsk1Initiator(KeyPair localStaticKeyPair, PublicKey remoteStaticPublicKey, byte[] preSharedKey) Constructs a new Noise handshake builder for the initiator in an Xpsk1 handshake.static NoiseHandshakeBuilderforXPsk1Responder(KeyPair localStaticKeyPair, byte[] preSharedKey) Constructs a new Noise handshake builder for the responder in an Xpsk1 handshake.static NoiseHandshakeBuilderforXResponder(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the responder in an X handshake.static NoiseHandshakeBuilderforXX1Initiator(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the initiator in an XX1 handshake.static NoiseHandshakeBuilderforXX1Responder(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the responder in an XX1 handshake.static NoiseHandshakeBuilderforXXInitiator(KeyPair localStaticKeyPair) Constructs a new Noise handshake builder for the initiator in an XX handshake.static NoiseHandshakeBuilderforXXPsk3Initiator(KeyPair localStaticKeyPair, byte[] preSharedKey) Constructs a new Noise handshake builder for the initiator in an XXpsk3 handshake.static NoiseHandshakeBuilderforXXPsk3Responder(KeyPair localStaticKeyPair, byte[] preSharedKey) Constructs a new Noise handshake builder for the responder in an XXpsk3 handshake.static NoiseHandshakeBuilderforXXResponder(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 benullremoteStaticPublicKey- 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 benullremoteStaticPublicKey- 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 benullremoteStaticPublicKey- 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 benullremoteStaticPublicKey- 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 benullremoteStaticPublicKey- 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 benullremoteStaticPublicKey- 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 benullremoteStaticPublicKey- 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 benullremoteStaticPublicKey- 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 benullremoteStaticPublicKey- 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 benullremoteStaticPublicKey- 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 benullremoteStaticPublicKey- 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 benullremoteStaticPublicKey- 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 benullremoteStaticPublicKey- 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 benullremoteStaticPublicKey- 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 benullremoteStaticPublicKey- 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 benullremoteStaticPublicKey- 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 benullremoteStaticPublicKey- 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 benullremoteStaticPublicKey- 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 benullremoteStaticPublicKey- 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 benullremoteStaticPublicKey- 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 benullremoteStaticPublicKey- 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 benullremoteStaticPublicKey- 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 benullremoteStaticPublicKey- 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 benullpreSharedKey- the pre-shared key for this handshake; must not benull- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException- if any required keynullIllegalArgumentException- 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 benullpreSharedKey- the pre-shared key for this handshake; must not benull- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException- if any required keynullIllegalArgumentException- 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 benullremoteStaticPublicKey- the remote static public key for this handshake; must not benullpreSharedKey- the pre-shared key for this handshake; must not benull- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException- if any required keynullIllegalArgumentException- 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 benullremoteStaticPublicKey- the remote static public key for this handshake; must not benullpreSharedKey- the pre-shared key for this handshake; must not benull- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException- if any required keynullIllegalArgumentException- 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 benullremoteStaticPublicKey- the remote static public key for this handshake; must not benullpreSharedKey- the pre-shared key for this handshake; must not benull- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException- if any required keynullIllegalArgumentException- 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 benullpreSharedKey- the pre-shared key for this handshake; must not benull- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException- if any required keynullIllegalArgumentException- 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 keynullIllegalArgumentException- 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 keynullIllegalArgumentException- 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 keynullIllegalArgumentException- 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 keynullIllegalArgumentException- 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 benullpreSharedKey- the pre-shared key for this handshake; must not benull- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException- if any required keynullIllegalArgumentException- 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 benullpreSharedKey- the pre-shared key for this handshake; must not benull- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException- if any required keynullIllegalArgumentException- 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 benullpreSharedKey- the pre-shared key for this handshake; must not benull- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException- if any required keynullIllegalArgumentException- 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 benullpreSharedKey- the pre-shared key for this handshake; must not benull- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException- if any required keynullIllegalArgumentException- 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 keynullIllegalArgumentException- 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 benullpreSharedKey- the pre-shared key for this handshake; must not benull- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException- if any required keynullIllegalArgumentException- 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 benullpreSharedKey- the pre-shared key for this handshake; must not benull- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException- if any required keynullIllegalArgumentException- 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 keynullIllegalArgumentException- 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 benullremoteStaticPublicKey- the remote static public key for this handshake; must not benullpreSharedKey- the pre-shared key for this handshake; must not benull- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException- if any required keynullIllegalArgumentException- 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 benullpreSharedKey- the pre-shared key for this handshake; must not benull- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException- if any required keynullIllegalArgumentException- 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 benullpreSharedKey- the pre-shared key for this handshake; must not benull- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException- if any required keynullIllegalArgumentException- 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 benullpreSharedKey- the pre-shared key for this handshake; must not benull- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException- if any required keynullIllegalArgumentException- 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 benullpreSharedKey- the pre-shared key for this handshake; must not benull- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException- if any required keynullIllegalArgumentException- 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 benullpreSharedKey- the pre-shared key for this handshake; must not benull- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException- if any required keynullIllegalArgumentException- 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 benullpreSharedKey- the pre-shared key for this handshake; must not benull- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException- if any required keynullIllegalArgumentException- 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 benullpreSharedKey- the pre-shared key for this handshake; must not benull- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException- if any required keynullIllegalArgumentException- 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 benullremoteStaticPublicKey- the remote static public key for this handshake; must not benullpreSharedKey- the pre-shared key for this handshake; must not benull- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException- if any required keynullIllegalArgumentException- 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 benullremoteStaticPublicKey- the remote static public key for this handshake; must not benullpreSharedKey- the pre-shared key for this handshake; must not benull- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException- if any required keynullIllegalArgumentException- 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 benullremoteStaticPublicKey- the remote static public key for this handshake; must not benullpreSharedKey- the pre-shared key for this handshake; must not benull- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException- if any required keynullIllegalArgumentException- 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 benullremoteStaticPublicKey- the remote static public key for this handshake; must not benullpreSharedKey- the pre-shared key for this handshake; must not benull- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException- if any required keynullIllegalArgumentException- 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 benullpreSharedKey- the pre-shared key for this handshake; must not benull- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException- if any required keynullIllegalArgumentException- 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 benullremoteStaticPublicKey- the remote static public key for this handshake; must not benullpreSharedKey- the pre-shared key for this handshake; must not benull- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException- if any required keynullIllegalArgumentException- 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 benullpreSharedKey- the pre-shared key for this handshake; must not benull- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException- if any required keynullIllegalArgumentException- 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 keynullIllegalArgumentException- 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 benullpreSharedKey- the pre-shared key for this handshake; must not benull- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException- if any required keynullIllegalArgumentException- 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 keynullIllegalArgumentException- 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 benullremoteStaticPublicKey- the remote static public key for this handshake; must not benullpreSharedKey- the pre-shared key for this handshake; must not benull- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException- if any required keynullIllegalArgumentException- 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 benullpreSharedKey- the pre-shared key for this handshake; must not benull- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException- if any required keynullIllegalArgumentException- 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 benullremoteStaticPublicKey- the remote static public key for this handshake; must not benullpreSharedKey- the pre-shared key for this handshake; must not benull- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException- if any required keynullIllegalArgumentException- 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 benullpreSharedKey- the pre-shared key for this handshake; must not benull- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException- if any required keynullIllegalArgumentException- 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 benullpreSharedKey- the pre-shared key for this handshake; must not benull- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException- if any required keynullIllegalArgumentException- 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 benullpreSharedKey- the pre-shared key for this handshake; must not benull- Returns:
- a new Noise handshake builder
- Throws:
NullPointerException- if any required keynullIllegalArgumentException- if the given pre-shared key is not exactly 32 bytes long
-