File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed
src/main/java/com/eatthepath/noise/component Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change 1+ package com .eatthepath .noise .component ;
2+
3+ import javax .crypto .KEM ;
4+ import javax .crypto .SecretKey ;
5+ import java .security .KeyPair ;
6+ import java .security .PrivateKey ;
7+ import java .security .PublicKey ;
8+
9+ public interface NoiseKeyEncapsulationMechanism {
10+
11+ static NoiseKeyEncapsulationMechanism getInstance (final String name ) {
12+ throw new IllegalArgumentException ("Unrecognized key encapsulation method name: " + name );
13+ }
14+
15+ String getName ();
16+
17+ KeyPair generateKeyPair ();
18+
19+ KEM .Encapsulated encapsulate (PublicKey publicKey );
20+
21+ byte [] decapsulate (PrivateKey privateKey , byte [] encapsulation );
22+
23+ int getPublicKeyLength ();
24+
25+ int getSharedSecretLength ();
26+
27+ int getEncapsulationLength ();
28+
29+ byte [] serializePublicKey (PublicKey publicKey );
30+
31+ PublicKey deserializePublicKey (byte [] publicKeyBytes );
32+
33+ byte [] serializeSharedSecret (SecretKey sharedSecret );
34+
35+ SecretKey deserializeSharedSecret (byte [] sharedSecretBytes );
36+ }
You can’t perform that action at this time.
0 commit comments