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 APDU

Class implementing support for command and response APDUs
Defined in: APDU.js.

Class Summary
Constructor Attributes | Constructor Name and Description
--- | ---
| APDU(command, cla, ins, p1, p2, data, Ne) Create an APDU This constructor supports the signatures APDU(ByteString command) APDU(Number cla, Number ins, Number p1, Number p2) APDU(Number cla, Number ins, Number p1, Number p2, data) APDU(Number cla, Number ins, Number p1, Number p2, data, Ne)

Method Summary
Method Attributes | Method Name and Description
--- | ---
| fromByteString(bs) Create an APDU object from the encoded form (Called internally)
| getCData() Gets the command data
| getCDataAsTLVList() Gets the command data as a list of TLV objects
| getCLA() Gets the class byte
| getCommandAPDU() Get encoded command APDU
| getINS() Gets the instruction byte
| getNe() Gets the number of expected bytes
| getP1() Gets the P1 byte
| getP2() Gets the P2 byte
| getRData() Get the response data
| getResponseAPDU() Get encoded response APDU
| getSecureChannel() Return the secure channel, if any
| getSW() Get the status word
| hasCData() Check if APDU has command data
| hasLe() Check if APDU has Le field
| hasRData() Check if APDU has response data
| hasSecureChannel() Test if a secure channel is defined for this APDU
| isAuthenticatedHeader() Test if command is send using secure messaging
| isChained() Test if command chaining is indicated
| isExtendedLength() Test if command uses extended length
| isISO() Test if command is an ISO command
| isSecureMessaging() Test if command is send using secure messaging
| setCData(cdata) Set the command data
| setCLA(cla) Sets the class byte, e.g.
| setRData(data) Sets the response data field for the response APDU
| setSecureChannel(secureChannel) Set secure channel object to be used in wrap and unwrap methods
| setSW(sw) Sets the status word for the response ADPU
<static> | APDU.test() Simple unit test
| toString() Return a human readable form of this object
| unwrap() Unwrap APDU using secure channel
| wrap() Wrap APDU using secure channel

Class Detail
APDU(command, cla, ins, p1, p2, data, Ne)
Create an APDU

This constructor supports the signatures

- APDU(ByteString command)
- APDU(Number cla, Number ins, Number p1, Number p2)
- APDU(Number cla, Number ins, Number p1, Number p2, data)
- APDU(Number cla, Number ins, Number p1, Number p2, data, Ne)

Parameters:
{ByteString} command
  the command APDU
{Number} cla
  the class byte
{Number} ins
  the instruction byte
{Number} p1
  the first parameter
{Number} p2
  the second parameter
{ByteString} data
  the data field (optional)
{Number} Ne
  the number of expected bytes (optional)

Method Detail
fromByteString(bs)
Create an APDU object from the encoded form (Called internally)

Parameters:
{ByteString} bs

{ByteString} getCData()
Gets the command data

Returns:
  the command data, if any else undefined

{TLVList} getCDataAsTLVList()
Gets the command data as a list of TLV objects

Returns:
  the command data as TLV list, if any else undefined

{Number} getCLA()
Gets the class byte

Returns:
  the class byte

{ByteString} getCommandAPDU()
Get encoded command APDU

Returns:
  the encoded command APDU

{Number} getINS()
Gets the instruction byte

Returns:
  the instruction byte

{Number} getNe()
Gets the number of expected bytes

Returns:
  the number of expected bytes or undefined

{Number} getP1()
Gets the P1 byte

Returns:
  the P1 byte

{Number} getP2()
Gets the P2 byte

Returns:
  the P2 byte

{ByteString} getRData()
Get the response data

Returns:
  the response data

{ByteString} getResponseAPDU()
Get encoded response APDU

Returns:
  the encoded response APDU

{SecureChannel} getSecureChannel()
Return the secure channel, if any

Returns:
  the secure channel

{Number} getSW()
Get the status word

Returns:
  the status word

{boolean} hasCData()
Check if APDU has command data

Returns:
  true if command APDU has data field

{boolean} hasLe()
Check if APDU has Le field

Returns:
  true if command APDU has Le field

{boolean} hasRData()
Check if APDU has response data

Returns:
  true if response APDU has data field

{boolean} hasSecureChannel()
Test if a secure channel is defined for this APDU

Returns:
  true, if secure channel is set

{boolean} isAuthenticatedHeader()
Test if command is send using secure messaging

Returns:
  true if secure messaging is using an authenticated header

{boolean} isChained()
Test if command chaining is indicated

Returns:
  true if chaining bit is set

{boolean} isExtendedLength()
Test if command uses extended length

Returns:
  true if APDU uses extended length

{boolean} isISO()
Test if command is an ISO command

Returns:
  true if command has ISO class byte

{boolean} isSecureMessaging()
Test if command is send using secure messaging

Returns:
  true if secure messaging is indicated in CLA byte

setCData(cdata)
Set the command data

Parameters:
{ByteString} cdata
  the command data

setCLA(cla)
Sets the class byte, e.g. after a transformation

Parameters:
cla

setRData(data)
Sets the response data field for the response APDU

Parameters:
{ByteString} data
  the response data field

setSecureChannel(secureChannel)
Set secure channel object to be used in wrap and unwrap methods

Parameters:
{SecureChannel} secureChannel
  the channel

setSW(sw)
Sets the status word for the response ADPU

Parameters:
{Number} sw
  the status word

<static> APDU.test()
Simple unit test

toString()
Return a human readable form of this object

unwrap()
Unwrap APDU using secure channel

wrap()
Wrap APDU using secure channel

Documentation generated by JsDoc Toolkit 2.4.0 on Fri Mar 27 2026 16:43:33 GMT+0100 (CET)