ca.h
Go to the documentation of this file.
/*
* Copyright (c) 2010-2012 Frank Morgner and Dominik Oepen
*
* This file is part of OpenPACE.
*
* OpenPACE is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option)
* any later version.
*
* OpenPACE is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* OpenPACE. If not, see <http://www.gnu.org/licenses/>.
*
* Additional permission under GNU GPL version 3 section 7
*
* If you modify this Program, or any covered work, by linking or combining it
* with OpenSSL (or a modified version of that library), containing
* parts covered by the terms of OpenSSL's license, the licensors of
* this Program grant you additional permission to convey the resulting work.
* Corresponding Source for a non-source form of such a combination shall include
* the source code for the parts of OpenSSL used as well as that of the
* covered work.
*
* If you modify this Program, or any covered work, by linking or combining it
* with OpenSC (or a modified version of that library), containing
* parts covered by the terms of OpenSC's license, the licensors of
* this Program grant you additional permission to convey the resulting work.
* Corresponding Source for a non-source form of such a combination shall include
* the source code for the parts of OpenSC used as well as that of the
* covered work.
*/
#ifndef CA_H_
#define CA_H_
#include "eac.h"
#include <openssl/buffer.h>
#ifdef __cplusplus
extern "C" {
#endif
#define CA_FLAG_DISABLE_PASSIVE_AUTH 1
void CA_disable_passive_authentication(EAC_CTX *ctx);
BUF_MEM *
CA_get_pubkey(const EAC_CTX *ctx,
const unsigned char *ef_cardsecurity,
size_t ef_cardsecurity_len);
int
CA_set_key(const EAC_CTX *ctx,
const unsigned char *priv, size_t priv_len,
const unsigned char *pub, size_t pub_len);
BUF_MEM *
CA_STEP1_get_pubkey(const EAC_CTX *ctx);
BUF_MEM *
CA_STEP2_get_eph_pubkey(const EAC_CTX *ctx);
int
CA_STEP3_check_pcd_pubkey(const EAC_CTX *ctx,
const BUF_MEM *comp_pubkey, const BUF_MEM *pubkey);
int
CA_STEP4_compute_shared_secret(const EAC_CTX *ctx, const BUF_MEM *pubkey);
int
CA_STEP5_derive_keys(const EAC_CTX *ctx, const BUF_MEM *pub,
BUF_MEM **nonce, BUF_MEM **token);
int
CA_STEP6_derive_keys(EAC_CTX *ctx, const BUF_MEM *nonce, const BUF_MEM *token);
#ifdef __cplusplus
}
#endif
#endif
CA_get_pubkey
BUF_MEM * CA_get_pubkey(const EAC_CTX *ctx, const unsigned char *ef_cardsecurity, size_t ef_cardsecurity_len)
Extract the public key from a EF.CardSecurity file.
CA_set_key
int CA_set_key(const EAC_CTX *ctx, const unsigned char *priv, size_t priv_len, const unsigned char *pub, size_t pub_len)
Initialize the CA context with keys.
eac.h
Interface for Extended Access Control.
CA_STEP6_derive_keys
int CA_STEP6_derive_keys(EAC_CTX *ctx, const BUF_MEM *nonce, const BUF_MEM *token)
Derives the PCD's encryption and authentication keys.
CA_STEP5_derive_keys
int CA_STEP5_derive_keys(const EAC_CTX *ctx, const BUF_MEM *pub, BUF_MEM **nonce, BUF_MEM **token)
Derives the PICC's encryption and authentication keys.
CA_STEP2_get_eph_pubkey
BUF_MEM * CA_STEP2_get_eph_pubkey(const EAC_CTX *ctx)
Get the PCD's ephemeral public key (generated in TA step 3)
CA_STEP4_compute_shared_secret
int CA_STEP4_compute_shared_secret(const EAC_CTX *ctx, const BUF_MEM *pubkey)
Compute the shared secret using the PICC's static key pair and the PCD's ephemeral key pair.
CA_STEP3_check_pcd_pubkey
int CA_STEP3_check_pcd_pubkey(const EAC_CTX *ctx, const BUF_MEM *comp_pubkey, const BUF_MEM *pubkey)
Check whether the public key matches the compressed public key previously received in TA.
CA_STEP1_get_pubkey
BUF_MEM * CA_STEP1_get_pubkey(const EAC_CTX *ctx)
Get the PICC's encoded public key.
CA_disable_passive_authentication
void CA_disable_passive_authentication(EAC_CTX *ctx)
Disable passive authentication for this EAC_CTX.
eac_ctx
Context for the Extended Access Control protocol.
Definition eac.h:342