JsDoc Reference - ChipAuthentication

Class Index | File Index

## Classes

- _global_
- AccessController
- APDU
- AuthenticationObject
- CAConnection
- ChipAuthentication
- ChipAuthenticationDomainParameterInfo
- ChipAuthenticationInfo
- ChipAuthenticationPublicKeyInfo
- CommandInterpreter
- CRLGenerator
- CVC
- CVCCA
- CVCertificateStore
- DataUnitAPDU
- DF
- DKEK
- DNEncoder
- EAC20
- EAC2CVCertificateGenerator
- EAC2CVRequestGenerator
- FCP
- File
- FileEncryptor
- FileSelector
- FileSystemIdObject
- FSNode
- GPSCP03
- HSMCVCertificateStore
- HSMKeyStore
- LinearEF
- ManagePKA
- P11CVCertificateStore
- PACE
- PACEDomainParameterInfo
- PACEInfo
- PaperKeyEncoding
- PKCS10Generator
- PublicKeyFile
- PublicKeyReference
- RAMClient
- RestrictedIdentificationDomainParameterInfo
- RestrictedIdentificationInfo
- SecureChannelHandler
- SecureMessagingCommandAPDUDecoder
- SecurityEnvironment
- SignatureKey
- SmartCardHSM
- SmartCardHSMCrypto
- SmartCardHSMInitializer
- SmartCardHSMKey
- SmartCardHSMKeySpecGenerator
- SmartCardHSMSymmetricKeySpecGenerator
- TransparentEF
- TrustAnchor
- X509CertificateGenerator
- X509CertificateIssuer
- X509CertificateStore
- X509Signer

# Class ChipAuthentication

This class implements the ChipAuthentication protocol
Defined in: ChipAuthentication.js.

Class Summary
Constructor Attributes | Constructor Name and Description
--- | ---
| ChipAuthentication(crypto, algo, domparam) Create a ChipAuthentication protocol object

Method Summary
Method Attributes | Method Name and Description
--- | ---
| calculateAuthenticationToken(the) Calculate the authentication token over the public key received from the other side
| decodeEphemeralPublicKey(encodedKey) Decodes the ephemeral public key
| deriveKey(input, counter, the) Derive key from input parameter, counter and optional nonce
<static> | ChipAuthentication.encodePublicKey(oid, key, withDP) Encode an ECC public key in the format defined by the EAC 2.0 specification
| generateEphemeralCAKeyPair() Generate ephemeral key pair
| getCompressedPublicKey() Returns the x coordinate of the public key
| getEphemeralPublicKey() Returns the ephemeral public key
| performKeyAgreement(publicKey, nonce) Performs the mapping operation with mapping data from the other side
| setKeyPair(prk, puk) Set chip authentication keys
<static> | ChipAuthentication.stripLeadingZeros(value) Strips leading zeros of a ByteString
| verifyAuthenticationToken(the) Calculate and verify the authentication token over the public key received from the other side

Class Detail
ChipAuthentication(crypto, algo, domparam)
Create a ChipAuthentication protocol object

Parameters:
{Crypto} crypto
  the crypto provider
{ByteString} algo
  the algorithm OID
{Key} domparam
  the key object holding ECC domain parameter

Method Detail
{Boolean} calculateAuthenticationToken(the)
Calculate the authentication token over the public key received from the other side

Parameters:
{ByteString} the
  MAC over the authentication data

Returns:
  true if the MAC is valid

{ByteString} decodeEphemeralPublicKey(encodedKey)
Decodes the ephemeral public key

Parameters:
encodedKey

Returns:
  the decoded public key

{Key} deriveKey(input, counter, the)
Derive key from input parameter, counter and optional nonce

Parameters:
{ByteString} input
  the first part of the hash input
{Number} counter
  the counter value
{nonce} the
  optional nonce inserted between the input and the counter

Returns:
  the key object

<static> ChipAuthentication.encodePublicKey(oid, key, withDP)
Encode an ECC public key in the format defined by the EAC 2.0 specification

Parameters:
{String} oid
  the object identifier to encode
{Key} key
  the EC public key
{Boolean} withDP
  true to encode domain parameter as well

generateEphemeralCAKeyPair()
Generate ephemeral key pair

{ByteString} getCompressedPublicKey()
Returns the x coordinate of the public key

Returns:
  the encoded public key

{ByteString} getEphemeralPublicKey()
Returns the ephemeral public key

Returns:
  the encoded public key

performKeyAgreement(publicKey, nonce)
Performs the mapping operation with mapping data from the other side

Parameters:
{ByteString} publicKey
  the public key in encoded format
nonce

setKeyPair(prk, puk)
Set chip authentication keys

Parameters:
{Key} prk
  the private key
{Key} puk
  the public key

<static> {ByteString} ChipAuthentication.stripLeadingZeros(value)
Strips leading zeros of a ByteString

Parameters:
{ByteString} value
  the ByteString value

Returns:
  the stripped ByteString object, may be an empty ByteString

{Boolean} verifyAuthenticationToken(the)
Calculate and verify the authentication token over the public key received from the other side

Parameters:
{ByteString} the
  MAC over the authentication data

Returns:
  true if the MAC is valid

Documentation generated by JsDoc Toolkit 2.4.0 on Wed Mar 18 2026 21:29:18 GMT+0100 (CET)