calypso_sam_commands.c
NAME
SpringCard Calypso API :: SAM command set
COPYRIGHT
(c) 2008 PRO ACTIVE SAS - See LICENCE.txt for licence information
AUTHOR
Johann Dantant / PRO ACTIVE
HISTORY
JDA 21/10/2008 : first public release
NAME
CalypsoSamCipherCardDataEx
DESCRIPTION
Ask the SAM to cipher data to be transmitted to the card
INPUTS
CALYPSO_CTX_ST *ctx : library context
BYTE apdu_p1
BYTE apdu_p2
const BYTE plain[]
CALYPSO_SZ plainsize
BYTE cipher[]
CALYPSO_SZ *ciphersize
RETURNS
CALYPSO_RC : 0 or an error code
NAME
CalypsoSamDigestAuthenticate
DESCRIPTION
Verify card's signature after CalypsoCardCloseSecureSession
INPUTS
CALYPSO_CTX_ST *ctx : library context
const BYTE card_sign[4] : signature returned by the card
RETURNS
CALYPSO_RC : 0 or an error code
NAME
CalypsoSamDigestClose
DESCRIPTION
SAM-side counterpart of CalypsoCardCloseSecureSession
INPUTS
CALYPSO_CTX_ST *ctx : library context
BYTE sam_sign[4] : signature computed by the SAM
(to be forwarded to the card)
RETURNS
CALYPSO_RC : 0 or an error code
NAME
CalypsoSamDigestInit
DESCRIPTION
SAM-side counterpart of CalypsoCardOpenSecureSession1, CalypsoCardOpenSecureSession2
or CalypsoCardOpenSecureSession3
INPUTS
CALYPSO_CTX_ST *ctx : library context
BYTE kif : key identifier
BYTE kvc : key version and counter
const BYTE cardresp[] : card's answer to the open secure session command
(including its challenge)
CALYPSO_SZ cardrespsize : length of cardresp
RETURNS
CALYPSO_RC : 0 or an error code
NAME
CalypsoSamDigestUpdate
DESCRIPTION
Forward a card's APDU (in/out) to the SAM
INPUTS
CALYPSO_CTX_ST *ctx : library context
const BYTE cardapdu[] : APDU
CALYPSO_SZ cardapdusize : length of the APDU
RETURNS
CALYPSO_RC : 0 or an error code
NAME
CalypsoSamGetChallenge
DESCRIPTION
Retrieve the challenge from the SAM, to be used in CalypsoCardOpenSecureSession1,
CalypsoCardOpenSecureSession2 or CalypsoCardOpenSecureSession3
INPUTS
CALYPSO_CTX_ST *ctx : library context
BYTE sam_chal[4] : the UID of the card
RETURNS
CALYPSO_RC : 0 or an error code
NAME
CalypsoSamGiveRandom
DESCRIPTION
Feed the SAM with a challenge generated by the card
INPUTS
CALYPSO_CTX_ST *ctx : library context
const BYTE challenge[8] : the challenge returned by the card
RETURNS
CALYPSO_RC : 0 or an error code
SEE ALSO
CalypsoCardGetChallenge
NAME
CalypsoSamSelectDiversifier
DESCRIPTION
Feed the SAM with the UID of the card currently being worked on
INPUTS
CALYPSO_CTX_ST *ctx : library context
const BYTE card_uid[8] : the UID of the card
RETURNS
CALYPSO_RC : 0 or an error code
Generated from
calypso_sam_commands.c on Tue Jan 24 12:33:50 2012