Class ChipAuthentication
This class implements the ChipAuthentication protocol
Defined in: ChipAuthentication.js.
Constructor Attributes | Constructor Name and Description |
---|---|
ChipAuthentication(crypto, algo, domparam)
Create a ChipAuthentication protocol object
|
Method Attributes | Method Name and Description |
---|---|
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
|
Generate ephemeral key pair
|
|
Returns the x coordinate of the public key
|
|
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
|
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