From fa7aa7f8dc857bae547fe6981fa6fc2b065b2004 Mon Sep 17 00:00:00 2001 From: lloyd Date: Wed, 8 Oct 2008 19:53:53 +0000 Subject: Add Card Verifiable Certificates from InSiTo (does not built due to missing parts, not included in build by default) --- src/cert/cvc/cvc_ca.cpp | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 src/cert/cvc/cvc_ca.cpp (limited to 'src/cert/cvc/cvc_ca.cpp') diff --git a/src/cert/cvc/cvc_ca.cpp b/src/cert/cvc/cvc_ca.cpp new file mode 100644 index 000000000..19b35e074 --- /dev/null +++ b/src/cert/cvc/cvc_ca.cpp @@ -0,0 +1,42 @@ +#include +#include +#include +#include +#include +namespace Botan { + + EAC1_1_CVC EAC1_1_CVC_CA::make_cert( + std::auto_ptr signer, + MemoryRegion const& public_key, + ASN1_Car const& car, + ASN1_Chr const& chr, + byte holder_auth_templ, + ASN1_Ced ced, + ASN1_Cex cex + ) + { + OID chat_oid(OIDS::lookup("CertificateHolderAuthorizationTemplate")); + MemoryVector enc_chat_val; + enc_chat_val.append(holder_auth_templ); + + MemoryVector enc_cpi; + enc_cpi.append(0x00); + MemoryVector tbs = DER_Encoder() + .encode(enc_cpi, OCTET_STRING, ASN1_Tag(41), APPLICATION) // cpi + .encode(car) + .raw_bytes(public_key) + .encode(chr) + .start_cons(ASN1_Tag(76), APPLICATION) + .encode(chat_oid) + .encode(enc_chat_val, OCTET_STRING, ASN1_Tag(19), APPLICATION) + .end_cons() + .encode(ced) + .encode(cex) + .get_contents(); + + MemoryVector signed_cert = EAC1_1_CVC::make_signed(signer, EAC1_1_CVC::build_cert_body(tbs)); + std::tr1::shared_ptr source(new DataSource_Memory(signed_cert)); + return EAC1_1_CVC(source); + } + +} -- cgit v1.2.3