Package-level declarations

Types

Link copied to clipboard
interface Aead

AEAD with the COSE convention: ciphertext output is ciphertext || tag.

Link copied to clipboard

AEAD algorithms (RFC 9053 §4, RFC 8439 for ChaCha20/Poly1305).

Link copied to clipboard
fun interface AesBlockCipher

Forward AES block permutation. CCM, CTR and CBC-MAC only ever need the encrypt direction.

Link copied to clipboard
class AesCcm(block: AesBlockCipher, val tagLength: Int, val nonceLength: Int) : Aead

AES-CCM (RFC 3610 / NIST SP 800-38C) on top of a raw AES block cipher.

Link copied to clipboard
class CertificateValidationException(message: String, cause: Throwable? = null) : Exception

A chain that a CertificateValidator does not trust.

Link copied to clipboard
fun interface CertificateValidator

Validates an X.509 chain against trust anchors: path, signatures, validity, usage. Shared by EDHOC (x5chain, x5t) and DTLS/TLS certificate mode. Name checks against the request belong to the caller. Parsing is not its job: dev.kcoap.crypto.x509.X509Certificate reads the parts the protocols need.

Link copied to clipboard
interface CryptoBackend

The single seam between protocol code and cryptography, in the spirit of libedhoc's crypto vtable: protocol modules never call a platform API directly, so a backend can be replaced by one for a secure element, Android KeyStore / Secure Enclave keys, a post-quantum provider, or a deterministic test double.

Link copied to clipboard

Curves for ephemeral and static Diffie-Hellman (COSE "Elliptic Curves" registry).

Link copied to clipboard

Converts ECDSA signatures between the raw r || s of CryptoBackend.sign and CryptoBackend.verify (COSE, RFC 9053 §2.1) and the DER ECDSA-Sig-Value ::= SEQUENCE { r INTEGER, s INTEGER } of X.509 and TLS (RFC 3279 §2.2.3, RFC 8422 §5.4).

Link copied to clipboard

Hash functions used by OSCORE and EDHOC. COSE ids from the IANA "COSE Algorithms" registry.

Link copied to clipboard
class Hkdf(crypto: CryptoBackend, val algorithm: HashAlgorithm)

HKDF (RFC 5869) built on CryptoBackend.hmac.

Link copied to clipboard

Key-encapsulation mechanisms (FIPS 203), used by the post-quantum EDHOC cipher suites. The private keys of the keyType are the seed or the expanded decapsulation key (KeyType.seedLength, KeyType.expandedPrivateKeyLength).

Link copied to clipboard
class KemEncapsulation(val ciphertext: ByteArray, sharedSecret: ByteArray)

The result of a KEM encapsulation (FIPS 203 §7.2): ciphertext goes to the key owner, the shared secret stays here.

Link copied to clipboard
class KeyPair(publicKey: ByteArray, val privateKey: PrivateKey)

A public key in the raw encoding of its KeyType, with the handle of its private key.

Link copied to clipboard

Kinds of asymmetric keys, with their raw encodings. Every public key crossing the CryptoBackend boundary uses the encoding documented here; protocol code converts to and from wire formats.

Link copied to clipboard
object Kmac256

KMAC256 (NIST SP 800-185 §4). EDHOC uses it for EDHOC_Extract and EDHOC_Expand when the suite's hash is SHAKE256 (RFC 9528 §4.1).

Link copied to clipboard
abstract class PrivateKey

A private key, as a handle owned by a CryptoBackend. Protocol code never sees key material: it passes the handle back to the backend that created it. A backend for a secure element, Android KeyStore or the Secure Enclave subclasses this with a reference to the stored key.

Link copied to clipboard
object Sec1

Compressed SEC1 points (02 || x or 03 || x) for P-256 and P-384, expanded to the uncompressed 04 || x || y that KeyType.P256 and KeyType.P384 document (SEC 1 v2 §2.3.4).

Link copied to clipboard
object Shake256

SHAKE256 (FIPS 202) in common code. No platform API offers it everywhere, and the post-quantum EDHOC suites (draft-ietf-lake-pqsuites, libedhoc suite -24) use it as their hash.

Link copied to clipboard

Signature algorithms (COSE "Algorithms" registry). ML-DSA ids from draft-ietf-cose-dilithium.

Link copied to clipboard

A private key held in memory, used by software backends. encoded hands the raw bytes to the backend that performs the operation; nothing else should call it.

Link copied to clipboard

The backend does not provide algorithm where it runs. A backend reports a missing capability this way and no other, and the supports members of CryptoBackend answer false exactly where an operation would throw it.