Class SecureMessagingCommandAPDUDecoder
Decoder for a secure messaging APDU
Defined in: SecureMessagingCommandAPDUDecoder.js.
Constructor Attributes | Constructor Name and Description |
---|---|
SecureMessagingCommandAPDUDecoder(channel, apdu)
Creates a decoder for a single secure messaging command APDU
|
Method Attributes | Method Name and Description |
---|---|
Build the MAC input block
|
|
decryptBody(key)
Decrypt the body of a secure messaging APDU
|
|
getLe()
Return value of optional Le element with tag '97'
|
|
<static> |
SecureMessagingCommandAPDUDecoder.pad(buffer, blocksize)
Applies ISO padding to the input buffer
|
<static> |
SecureMessagingCommandAPDUDecoder.removePadding(buffer)
Removes the ISO padding
|
Verify the message authentication code (MAC)
|
Class Detail
SecureMessagingCommandAPDUDecoder(channel, apdu)
Creates a decoder for a single secure messaging command APDU
- Parameters:
- {SecureChannel} channel
- the secure channel object
- {APDU} apdu
- the secure messaging APDU
Method Detail
{ByteString}
buildMACInput()
Build the MAC input block
- Returns:
- the MAC calculation input block
{ByteString}
decryptBody(key)
Decrypt the body of a secure messaging APDU
- Parameters:
- {Key} key
- the encryption key
- Returns:
- the plain body or undefined if no encrypted body
{Number}
getLe()
Return value of optional Le element with tag '97'
- Returns:
- the value of the Le element
<static>
{ByteBuffer}
SecureMessagingCommandAPDUDecoder.pad(buffer, blocksize)
Applies ISO padding to the input buffer
- Parameters:
- {ByteBuffer} buffer
- the input buffer
- {Number} blocksize
- the block size
- Returns:
- the buffer argument
<static>
{ByteString}
SecureMessagingCommandAPDUDecoder.removePadding(buffer)
Removes the ISO padding
- Parameters:
- {ByteString} buffer
- the input with with padding
- Returns:
- the buffer without padding
{boolean}
verifyMAC()
Verify the message authentication code (MAC)
- Returns:
- true if the MAC is valid