public class HPKE
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static short |
aead_AES_GCM128 |
static short |
aead_AES_GCM256 |
static short |
aead_CHACHA20_POLY1305 |
static short |
aead_EXPORT_ONLY |
static short |
kdf_HKDF_SHA256 |
static short |
kdf_HKDF_SHA384 |
static short |
kdf_HKDF_SHA512 |
static short |
kem_P256_SHA256 |
static short |
kem_P384_SHA348
Deprecated.
use kem_P384_SHA384
|
static short |
kem_P384_SHA384 |
static short |
kem_P521_SHA512 |
static short |
kem_X25519_SHA256 |
static short |
kem_X448_SHA512 |
static byte |
mode_auth |
static byte |
mode_auth_psk |
static byte |
mode_base |
static byte |
mode_psk |
| Constructor and Description |
|---|
HPKE(byte mode,
short kemId,
short kdfId,
short aeadId)
Hybrid Public Key Encryption as described in RFC9180.
|
HPKE(byte mode,
short kemId,
short kdfId,
short aeadId,
KEM kem,
int encSize) |
public static final byte mode_base
public static final byte mode_psk
public static final byte mode_auth
public static final byte mode_auth_psk
public static final short kem_P256_SHA256
public static final short kem_P384_SHA348
public static final short kem_P384_SHA384
public static final short kem_P521_SHA512
public static final short kem_X25519_SHA256
public static final short kem_X448_SHA512
public static final short kdf_HKDF_SHA256
public static final short kdf_HKDF_SHA384
public static final short kdf_HKDF_SHA512
public static final short aead_AES_GCM128
public static final short aead_AES_GCM256
public static final short aead_CHACHA20_POLY1305
public static final short aead_EXPORT_ONLY
public HPKE(byte mode,
short kemId,
short kdfId,
short aeadId)
public HPKE(byte mode,
short kemId,
short kdfId,
short aeadId,
KEM kem,
int encSize)
public int getEncSize()
public short getAeadId()
public AsymmetricCipherKeyPair generatePrivateKey()
public byte[] serializePublicKey(AsymmetricKeyParameter pk)
public byte[] serializePrivateKey(AsymmetricKeyParameter sk)
public AsymmetricKeyParameter deserializePublicKey(byte[] pkEncoded)
public AsymmetricCipherKeyPair deserializePrivateKey(byte[] skEncoded, byte[] pkEncoded)
public AsymmetricCipherKeyPair deriveKeyPair(byte[] ikm)
public byte[][] sendExport(AsymmetricKeyParameter pkR, byte[] info, byte[] exporterContext, int L, byte[] psk, byte[] pskId, AsymmetricCipherKeyPair skS)
public byte[] receiveExport(byte[] enc,
AsymmetricCipherKeyPair skR,
byte[] info,
byte[] exporterContext,
int L,
byte[] psk,
byte[] pskId,
AsymmetricKeyParameter pkS)
public byte[][] seal(AsymmetricKeyParameter pkR, byte[] info, byte[] aad, byte[] pt, byte[] psk, byte[] pskId, AsymmetricCipherKeyPair skS) throws InvalidCipherTextException
InvalidCipherTextExceptionpublic byte[] open(byte[] enc,
AsymmetricCipherKeyPair skR,
byte[] info,
byte[] aad,
byte[] ct,
byte[] psk,
byte[] pskId,
AsymmetricKeyParameter pkS)
throws InvalidCipherTextException
InvalidCipherTextExceptionpublic HPKEContextWithEncapsulation setupBaseS(AsymmetricKeyParameter pkR, byte[] info)
public HPKEContextWithEncapsulation setupBaseS(AsymmetricKeyParameter pkR, byte[] info, AsymmetricCipherKeyPair kpE)
public HPKEContext setupBaseR(byte[] enc, AsymmetricCipherKeyPair skR, byte[] info)
public HPKEContextWithEncapsulation SetupPSKS(AsymmetricKeyParameter pkR, byte[] info, byte[] psk, byte[] psk_id)
public HPKEContext setupPSKR(byte[] enc, AsymmetricCipherKeyPair skR, byte[] info, byte[] psk, byte[] psk_id)
public HPKEContextWithEncapsulation setupAuthS(AsymmetricKeyParameter pkR, byte[] info, AsymmetricCipherKeyPair skS)
public HPKEContext setupAuthR(byte[] enc, AsymmetricCipherKeyPair skR, byte[] info, AsymmetricKeyParameter pkS)
public HPKEContextWithEncapsulation setupAuthPSKS(AsymmetricKeyParameter pkR, byte[] info, byte[] psk, byte[] psk_id, AsymmetricCipherKeyPair skS)
public HPKEContext setupAuthPSKR(byte[] enc, AsymmetricCipherKeyPair skR, byte[] info, byte[] psk, byte[] psk_id, AsymmetricKeyParameter pkS)