GOST public key algorithm ENGINE donated to the OpenSSL by Cryptocom.
[openssl.git] / engines / ccgost / gost_asn1.h
1 /**********************************************************************
2  *                          gost_keytrans.h                           *
3  *             Copyright (c) 2005-2006 Cryptocom LTD                  *
4  *       This file is distributed under the same license as OpenSSL   *
5  *                                                                    *
6  *   ASN1 structure declaration for GOST key transport                *
7  *          Requires OpenSSL 0.9.9 for compilation                    *
8  **********************************************************************/
9 #ifndef GOST_KEY_TRANS_H
10 #define GOST_KEY_TRANS_H
11 #include <openssl/asn1t.h>
12 #include <openssl/x509.h>
13
14
15 typedef struct {
16         ASN1_OCTET_STRING *encrypted_key;
17         ASN1_OCTET_STRING *imit;
18 } GOST_KEY_INFO;
19
20 DECLARE_ASN1_FUNCTIONS(GOST_KEY_INFO)
21
22 typedef struct {
23         ASN1_OBJECT *cipher;
24         X509_PUBKEY *ephem_key;
25         ASN1_OCTET_STRING *eph_iv;
26 } GOST_KEY_AGREEMENT_INFO;
27
28 DECLARE_ASN1_FUNCTIONS(GOST_KEY_AGREEMENT_INFO)
29         
30 typedef struct {
31         GOST_KEY_INFO *key_info;
32         GOST_KEY_AGREEMENT_INFO *key_agreement_info;
33 } GOST_KEY_TRANSPORT;
34
35 DECLARE_ASN1_FUNCTIONS(GOST_KEY_TRANSPORT)
36
37 typedef struct { //FIXME incomplete
38         GOST_KEY_TRANSPORT *gkt;
39 } GOST_CLIENT_KEY_EXCHANGE_PARAMS;
40
41 DECLARE_ASN1_FUNCTIONS(GOST_CLIENT_KEY_EXCHANGE_PARAMS)
42 typedef struct {
43         ASN1_OBJECT *key_params;
44         ASN1_OBJECT *hash_params;
45         ASN1_OBJECT *cipher_params;
46 } GOST_KEY_PARAMS;
47
48 DECLARE_ASN1_FUNCTIONS(GOST_KEY_PARAMS)
49
50 typedef struct {
51         ASN1_OCTET_STRING *iv;
52         ASN1_OBJECT *enc_param_set;
53 } GOST_CIPHER_PARAMS; 
54
55 DECLARE_ASN1_FUNCTIONS(GOST_CIPHER_PARAMS)
56
57 #endif