Documentation
¶
Overview ¶
Package security provides functions for handling objects related to Secure Communication with a card.
Index ¶
Constants ¶
const ( // NotAuthenticated indicates that authentication status is neither AUTHENTICATED nor ANY_AUTHENTICATED. NotAuthenticated AuthenticationStatus = iota // Authenticated indicates authentication status AUTHENTICATED. Authenticated = iota // AnyAuthenticated indicates authentication status ANY_AUTHENTICATED. AnyAuthenticated = iota )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthenticationStatus ¶
type AuthenticationStatus int
AuthenticationStatus is the current authentication status of a secure channel session.
type Level ¶
type Level struct { AuthenticationStatus AuthenticationStatus CDEC bool // Command decryption. CMAC bool // Command Message Authentication Code. RMAC bool // Response Message Authentication Code. RENC bool // Response encryption. }
Level provides secure messaging protection levels that are applied to protected messages, either for the whole session or for a specific command-response pair. The rules for handling Security Levels are defined individually for each Secure Channel Protocol.
func ParseLevel ¶
ParseLevel parses the current security level and returns Level.
type SCP02Parameter ¶
type SCP02Parameter struct { ThreeSCKeys bool // true: 3 Secure Channel Keys, false: 1 Secure Channel base key CMACOnUnmodifiedAPDU bool // true: C-MAC on unmodified APDU, false: C-MAC on modified APDU ExplicitInitiation bool // true: Initiation mode explicit, false: Initiation mode implicit ICVMacOverAID bool // true: ICV set to MAC over AID, false: ICV set to zero ICVEncryptionForCMAC bool // true: ICV encryption for C-MAC session, false: No ICV encryption RMACSupported bool // true: R-MAC support, false: No R-MAC support KnownPseudoRandomAlgorithm bool // true: Well-known pseudo-random algorithm (card challenge), false: Unspecified card challenge generation method }
SCP02Parameter contains options encoded on the i-Parameter for SCP02.
func ParseSCP02Parameter ¶
func ParseSCP02Parameter(i byte) *SCP02Parameter
ParseSCP02Parameter parses the i-Param for SCP02 and returns SCP02Parameter.
func (SCP02Parameter) Byte ¶
func (param SCP02Parameter) Byte() byte
Byte encodes SCP02Parameter on a byte.
type SCP03Parameter ¶
type SCP03Parameter struct { PseudoRandomCardChallenge bool // true:Pseudo-random card challenge, false: Random card challenge RMACSupport bool // Response MAC. RENCSupport bool // Response encryption. }
SCP03Parameter contains options encoded on the i-Parameter for SCP03.
func ParseSCP03Parameter ¶
func ParseSCP03Parameter(i byte) *SCP03Parameter
ParseSCP03Parameter parses the i-Param for SCP03 and returns SCP03Parameter.
func (SCP03Parameter) Byte ¶
func (param SCP03Parameter) Byte() byte
Byte encodes SCP03Parameter on a byte.
type SCP10Parameter ¶
type SCP10Parameter struct { KeyAgreement bool // true: Key Agreement, false: Key Transport SignatureWithoutMessageRecovery bool // true: Signature without message recovery, false: Signature with message recovery }
SCP10Parameter contains options encoded on the i-Parameter for SCP10.
func ParseSCP10Parameter ¶
func ParseSCP10Parameter(i byte) *SCP10Parameter
ParseSCP10Parameter parses the i-Param for SCP10 and returns SCP10Parameter.
func (SCP10Parameter) Byte ¶
func (param SCP10Parameter) Byte() byte
Byte encodes SCP10Parameter on a byte.
type SCPParameter ¶
SCPParameter is used for storing data about SCPs that might be unknown to the current implementation.