summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2003-04-16 10:44:12 +0000
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2003-04-16 10:44:12 +0000
commitf0eb96e3762d825c9e0d30e6d93601c75fe1dab4 (patch)
treec987ec2797c29977576b480135ebdc2e3afa4884
parentb1d596003a6cb55139a89c2f64b691180608ec37 (diff)
downloadgnutls-f0eb96e3762d825c9e0d30e6d93601c75fe1dab4.tar.gz
added definitions for pkcs12
-rw-r--r--lib/pkix.asn114
-rw-r--r--lib/pkix_asn1_tab.c112
2 files changed, 210 insertions, 16 deletions
diff --git a/lib/pkix.asn b/lib/pkix.asn
index 8384e8e13b..044b028d4b 100644
--- a/lib/pkix.asn
+++ b/lib/pkix.asn
@@ -481,8 +481,11 @@ X520countryName ::= PrintableString (SIZE (2)) -- IS 3166 codes
-- Legacy attributes
+pkcs OBJECT IDENTIFIER ::=
+ { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) }
+
pkcs-9 OBJECT IDENTIFIER ::=
- { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) 9 }
+ { pkcs 9 }
emailAddress AttributeType ::= { pkcs-9 1 }
@@ -601,7 +604,7 @@ AlgorithmIdentifier ::= SEQUENCE {
-- Algorithm OIDs and parameter structures
pkcs-1 OBJECT IDENTIFIER ::= {
- iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) 1 }
+ pkcs 1 }
rsaEncryption OBJECT IDENTIFIER ::= { pkcs-1 1 }
@@ -1009,6 +1012,9 @@ CertificationRequest ::= SEQUENCE {
pkcs-9-ub-challengePassword INTEGER ::= 255
+pkcs-9-certTypes OBJECT IDENTIFIER ::= {pkcs-9 22}
+pkcs-9-crlTypes OBJECT IDENTIFIER ::= {pkcs-9 23}
+
challengePassword AttributeType ::= {pkcs-9 7}
Pkcs9challengePassword ::= CHOICE {
@@ -1044,7 +1050,7 @@ EncryptedData ::= OCTET STRING
-- PKCS #5 stuff
pkcs-5 OBJECT IDENTIFIER ::=
- { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) 5 }
+ { pkcs 5 }
pkcs-5-encryptionAlgorithm OBJECT IDENTIFIER ::=
{ iso(1) member-body(2) us(840) rsadsi(113549) 3 }
@@ -1078,4 +1084,106 @@ pkcs-5-PBKDF2-params ::= SEQUENCE {
prf AlgorithmIdentifier OPTIONAL -- DEFAULT pkcs-5-id-hmacWithSHA1
}
+-- PKCS #12 stuff
+
+pkcs-12 OBJECT IDENTIFIER ::= {pkcs 12}
+
+PFX ::= SEQUENCE {
+ version INTEGER {v3(3)},
+ authSafe ContentInfo,
+ macData MacData OPTIONAL
+}
+
+MacData ::= ANY
+-- we don't use it
+-- SEQUENCE {
+-- mac ANY, --DigestInfo,
+-- macSalt OCTET STRING,
+-- iterations INTEGER DEFAULT 1
+-- Note: The default is for historical reasons and its use is
+-- deprecated. A higher value, like 1024 is recommended.
+--}
+
+AuthenticatedSafe ::= SEQUENCE OF ContentInfo
+ -- Data if unencrypted
+ -- EncryptedData if password-encrypted
+ -- EnvelopedData if public key-encrypted
+
+SafeContents ::= SEQUENCE OF SafeBag
+
+-- To replace TYPE-IDENTIFIER
+BAG-TYPE ::= SEQUENCE {
+ type-id OBJECT IDENTIFIER,
+ value [0] EXPLICIT ANY DEFINED BY type-id }
+
+
+SafeBag ::= SEQUENCE {
+ bagId BAG-TYPE,
+ bagValue [0] EXPLICIT ANY DEFINED BY badId,
+ bagAttributes SET OF PKCS12Attribute OPTIONAL
+}
+
+-- Bag types
+
+
+bagtypes OBJECT IDENTIFIER ::= {pkcs-12 10 1}
+
+keyBag OBJECT IDENTIFIER ::= {bagtypes 1}
+pkcs8ShroudedKeyBag OBJECT IDENTIFIER ::= {bagtypes 2}
+certBag OBJECT IDENTIFIER ::= {bagtypes 3}
+crlBag OBJECT IDENTIFIER ::= {bagtypes 4}
+
+KeyBag ::= PrivateKeyInfo
+
+-- Shrouded KeyBag
+
+PKCS8ShroudedKeyBag ::= EncryptedPrivateKeyInfo
+
+-- CertBag
+
+CertBag ::= SEQUENCE {
+ certId BAG-TYPE,
+ certValue [0] EXPLICIT ANY DEFINED BY certId
+}
+
+-- x509Certificate BAG-TYPE ::= {OCTET STRING IDENTIFIED BY {pkcs-9-certTypes 1}}
+-- DER-encoded X.509 certificate stored in OCTET STRING
+
+CRLBag ::= SEQUENCE {
+ crlId BAG-TYPE,
+ crlValue [0] EXPLICIT ANY DEFINED BY crlId
+}
+
+-- x509CRL BAG-TYPE ::=
+-- {OCTET STRING IDENTIFIED BY {pkcs-9-crlTypes 1}}
+-- DER-encoded X.509 CRL stored in OCTET STRING
+
+PKCS12Attribute ::= ANY
+
+-- PKCS #7 stuff (needed in PKCS 12)
+
+id-data OBJECT IDENTIFIER ::= { iso(1) member-body(2)
+ us(840) rsadsi(113549) pkcs(1) pkcs7(7) 1 }
+
+id-encryptedData OBJECT IDENTIFIER ::= { iso(1) member-body(2)
+ us(840) rsadsi(113549) pkcs(1) pkcs7(7) 6 }
+
+Data ::= OCTET STRING
+
+EncryptedData ::= SEQUENCE {
+ version CMSVersion,
+ encryptedContentInfo EncryptedContentInfo,
+ unprotectedAttrs [1] IMPLICIT UnprotectedAttributes OPTIONAL }
+
+EncryptedContentInfo ::= SEQUENCE {
+ contentType ContentType,
+ contentEncryptionAlgorithm ContentEncryptionAlgorithmIdentifier,
+ encryptedContent [0] IMPLICIT EncryptedContent OPTIONAL }
+
+ContentEncryptionAlgorithmIdentifier ::= AlgorithmIdentifier
+
+EncryptedContent ::= OCTET STRING
+
+UnprotectedAttributes ::= SET SIZE (1..MAX) OF Attribute
+
END
diff --git a/lib/pkix_asn1_tab.c b/lib/pkix_asn1_tab.c
index f2828f5aeb..b0e787d75d 100644
--- a/lib/pkix_asn1_tab.c
+++ b/lib/pkix_asn1_tab.c
@@ -480,12 +480,14 @@ const ASN1_ARRAY_TYPE pkix_asn1_tab[]={
{0,1,"6"},
{"X520countryName",1612709890,"PrintableString"},
{0,1048586,"2"},
- {"pkcs-9",1879048204,0},
+ {"pkcs",1879048204,0},
{"iso",1073741825,"1"},
{"member-body",1073741825,"2"},
{"us",1073741825,"840"},
{"rsadsi",1073741825,"113549"},
- {"pkcs",1073741825,"1"},
+ {"pkcs",1,"1"},
+ {"pkcs-9",1879048204,0},
+ {0,1073741825,"pkcs"},
{0,1,"9"},
{"emailAddress",1880096780,"AttributeType"},
{0,1073741825,"pkcs-9"},
@@ -576,11 +578,7 @@ const ASN1_ARRAY_TYPE pkix_asn1_tab[]={
{"parameters",541081613,0},
{"algorithm",1,0},
{"pkcs-1",1879048204,0},
- {"iso",1073741825,"1"},
- {"member-body",1073741825,"2"},
- {"us",1073741825,"840"},
- {"rsadsi",1073741825,"113549"},
- {"pkcs",1073741825,"1"},
+ {0,1073741825,"pkcs"},
{0,1,"1"},
{"rsaEncryption",1879048204,0},
{0,1073741825,"pkcs-1"},
@@ -912,6 +910,12 @@ const ASN1_ARRAY_TYPE pkix_asn1_tab[]={
{"signatureAlgorithm",1073741826,"AlgorithmIdentifier"},
{"signature",6,0},
{"pkcs-9-ub-challengePassword",1342177283,"255"},
+ {"pkcs-9-certTypes",1879048204,0},
+ {0,1073741825,"pkcs-9"},
+ {0,1,"22"},
+ {"pkcs-9-crlTypes",1879048204,0},
+ {0,1073741825,"pkcs-9"},
+ {0,1,"23"},
{"challengePassword",1880096780,"AttributeType"},
{0,1073741825,"pkcs-9"},
{0,1,"7"},
@@ -936,11 +940,7 @@ const ASN1_ARRAY_TYPE pkix_asn1_tab[]={
{"encryptedData",2,"EncryptedData"},
{"EncryptedData",1073741831,0},
{"pkcs-5",1879048204,0},
- {"iso",1073741825,"1"},
- {"member-body",1073741825,"2"},
- {"us",1073741825,"840"},
- {"rsadsi",1073741825,"113549"},
- {"pkcs",1073741825,"1"},
+ {0,1073741825,"pkcs"},
{0,1,"5"},
{"pkcs-5-encryptionAlgorithm",1879048204,0},
{"iso",1073741825,"1"},
@@ -962,7 +962,7 @@ const ASN1_ARRAY_TYPE pkix_asn1_tab[]={
{"pkcs-5-id-PBKDF2",1879048204,0},
{0,1073741825,"pkcs-5"},
{0,1,"12"},
- {"pkcs-5-PBKDF2-params",536870917,0},
+ {"pkcs-5-PBKDF2-params",1610612741,0},
{"salt",1610612754,0},
{"specified",1073741831,0},
{"otherSource",2,"AlgorithmIdentifier"},
@@ -971,5 +971,91 @@ const ASN1_ARRAY_TYPE pkix_asn1_tab[]={
{"keyLength",1611153411,0},
{"1",10,"MAX"},
{"prf",16386,"AlgorithmIdentifier"},
+ {"pkcs-12",1879048204,0},
+ {0,1073741825,"pkcs"},
+ {0,1,"12"},
+ {"PFX",1610612741,0},
+ {"version",1610874883,0},
+ {"v3",1,"3"},
+ {"authSafe",1073741826,"ContentInfo"},
+ {"macData",16386,"MacData"},
+ {"MacData",1073741837,0},
+ {"AuthenticatedSafe",1610612747,0},
+ {0,2,"ContentInfo"},
+ {"SafeContents",1610612747,0},
+ {0,2,"SafeBag"},
+ {"BAG-TYPE",1610612741,0},
+ {"type-id",1073741836,0},
+ {"value",541073421,0},
+ {0,1073743880,"0"},
+ {"type-id",1,0},
+ {"SafeBag",1610612741,0},
+ {"bagId",1073741826,"BAG-TYPE"},
+ {"bagValue",1614815245,0},
+ {0,1073743880,"0"},
+ {"badId",1,0},
+ {"bagAttributes",536887311,0},
+ {0,2,"PKCS12Attribute"},
+ {"bagtypes",1879048204,0},
+ {0,1073741825,"pkcs-12"},
+ {0,1073741825,"10"},
+ {0,1,"1"},
+ {"keyBag",1879048204,0},
+ {0,1073741825,"bagtypes"},
+ {0,1,"1"},
+ {"pkcs8ShroudedKeyBag",1879048204,0},
+ {0,1073741825,"bagtypes"},
+ {0,1,"2"},
+ {"certBag",1879048204,0},
+ {0,1073741825,"bagtypes"},
+ {0,1,"3"},
+ {"crlBag",1879048204,0},
+ {0,1073741825,"bagtypes"},
+ {0,1,"4"},
+ {"KeyBag",1073741826,"PrivateKeyInfo"},
+ {"PKCS8ShroudedKeyBag",1073741826,"EncryptedPrivateKeyInfo"},
+ {"CertBag",1610612741,0},
+ {"certId",1073741826,"BAG-TYPE"},
+ {"certValue",541073421,0},
+ {0,1073743880,"0"},
+ {"certId",1,0},
+ {"CRLBag",1610612741,0},
+ {"crlId",1073741826,"BAG-TYPE"},
+ {"crlValue",541073421,0},
+ {0,1073743880,"0"},
+ {"crlId",1,0},
+ {"PKCS12Attribute",1073741837,0},
+ {"id-data",1879048204,0},
+ {"iso",1073741825,"1"},
+ {"member-body",1073741825,"2"},
+ {"us",1073741825,"840"},
+ {"rsadsi",1073741825,"113549"},
+ {"pkcs",1073741825,"1"},
+ {"pkcs7",1073741825,"7"},
+ {0,1,"1"},
+ {"id-encryptedData",1879048204,0},
+ {"iso",1073741825,"1"},
+ {"member-body",1073741825,"2"},
+ {"us",1073741825,"840"},
+ {"rsadsi",1073741825,"113549"},
+ {"pkcs",1073741825,"1"},
+ {"pkcs7",1073741825,"7"},
+ {0,1,"6"},
+ {"Data",1073741831,0},
+ {"EncryptedData",1610612741,0},
+ {"version",1073741826,"CMSVersion"},
+ {"encryptedContentInfo",1073741826,"EncryptedContentInfo"},
+ {"unprotectedAttrs",536895490,"UnprotectedAttributes"},
+ {0,4104,"1"},
+ {"EncryptedContentInfo",1610612741,0},
+ {"contentType",1073741826,"ContentType"},
+ {"contentEncryptionAlgorithm",1073741826,"ContentEncryptionAlgorithmIdentifier"},
+ {"encryptedContent",536895490,"EncryptedContent"},
+ {0,4104,"0"},
+ {"ContentEncryptionAlgorithmIdentifier",1073741826,"AlgorithmIdentifier"},
+ {"EncryptedContent",1073741831,0},
+ {"UnprotectedAttributes",538968079,0},
+ {"MAX",1074266122,"1"},
+ {0,2,"Attribute"},
{0,0,0}
};