66 lines
1.7 KiB
C
66 lines
1.7 KiB
C
/*
|
|
* Automatically generated by asn1_compiler. Do not edit
|
|
*
|
|
* ASN.1 parser for pkcs8
|
|
*/
|
|
#include <linux/asn1_ber_bytecode.h>
|
|
#include "pkcs8.asn1.h"
|
|
|
|
enum pkcs8_actions {
|
|
ACT_pkcs8_note_OID = 0,
|
|
ACT_pkcs8_note_algo = 1,
|
|
ACT_pkcs8_note_key = 2,
|
|
ACT_pkcs8_note_version = 3,
|
|
NR__pkcs8_actions = 4
|
|
};
|
|
|
|
static const asn1_action_t pkcs8_action_table[NR__pkcs8_actions] = {
|
|
[ 0] = pkcs8_note_OID,
|
|
[ 1] = pkcs8_note_algo,
|
|
[ 2] = pkcs8_note_key,
|
|
[ 3] = pkcs8_note_version,
|
|
};
|
|
|
|
static const unsigned char pkcs8_machine[] = {
|
|
// PrivateKeyInfo
|
|
[ 0] = ASN1_OP_MATCH,
|
|
[ 1] = _tag(UNIV, CONS, SEQ),
|
|
// Version
|
|
[ 2] = ASN1_OP_MATCH_ACT,
|
|
[ 3] = _tag(UNIV, PRIM, INT),
|
|
[ 4] = _action(ACT_pkcs8_note_version),
|
|
// PrivateKeyAlgorithmIdentifier
|
|
// AlgorithmIdentifier
|
|
[ 5] = ASN1_OP_MATCH,
|
|
[ 6] = _tag(UNIV, CONS, SEQ),
|
|
[ 7] = ASN1_OP_MATCH_ACT, // algorithm
|
|
[ 8] = _tag(UNIV, PRIM, OID),
|
|
[ 9] = _action(ACT_pkcs8_note_OID),
|
|
[ 10] = ASN1_OP_MATCH_ANY_OR_SKIP, // parameters
|
|
[ 11] = ASN1_OP_END_SEQ,
|
|
[ 12] = ASN1_OP_ACT,
|
|
[ 13] = _action(ACT_pkcs8_note_algo),
|
|
// PrivateKey
|
|
[ 14] = ASN1_OP_MATCH_ACT,
|
|
[ 15] = _tag(UNIV, PRIM, OTS),
|
|
[ 16] = _action(ACT_pkcs8_note_key),
|
|
// Attributes
|
|
[ 17] = ASN1_OP_MATCH_JUMP_OR_SKIP, // attributes
|
|
[ 18] = _tagn(CONT, CONS, 0),
|
|
[ 19] = _jump_target(22), // --> Attributes
|
|
[ 20] = ASN1_OP_END_SEQ,
|
|
[ 21] = ASN1_OP_COMPLETE,
|
|
|
|
// Attribute
|
|
[ 22] = ASN1_OP_MATCH_ANY,
|
|
[ 23] = ASN1_OP_END_SET_OF,
|
|
[ 24] = _jump_target(22),
|
|
[ 25] = ASN1_OP_RETURN,
|
|
};
|
|
|
|
const struct asn1_decoder pkcs8_decoder = {
|
|
.machine = pkcs8_machine,
|
|
.machlen = sizeof(pkcs8_machine),
|
|
.actions = pkcs8_action_table,
|
|
};
|