1 // NOTE: this is a machine generated file--editing not recommended
3 // sm_cms.h - class definitions for ASN.1 module CryptographicMessageSyntax
5 // This file was generated by snacc on Wed Jun 27 16:40:55 2001
6 // UBC snacc by Mike Sample
7 // A couple of enhancements made by IBM European Networking Center
13 //------------------------------------------------------------------------------
14 // class declarations:
17 class OriginatorPublicKey
;
18 class CertificateRevocationLists
;
19 class IssuerAndSerialNumber
;
20 class OtherKeyAttribute
;
21 class DigestAlgorithmIdentifiers
;
22 class EncapsulatedContentInfo
;
23 class SignerIdentifier
;
24 class EncryptedContentInfo
;
25 class RecipientIdentifier
;
26 class OriginatorIdentifierOrKey
;
27 class RecipientKeyIdentifier
;
29 class ExtendedCertificateInfo
;
31 class KeyTransRecipientInfo
;
32 class KeyAgreeRecipientIdentifier
;
33 class KEKRecipientInfo
;
34 class ExtendedCertificate
;
36 class RecipientEncryptedKey
;
37 class CertificateChoices
;
40 class RecipientEncryptedKeys
;
41 class KeyAgreeRecipientInfo
;
49 class AuthenticatedData
;
50 class UserKeyingMaterials
;
51 class RC2CBCParameter
;
52 class ExtendedCertificateOrCertificate
;
55 //------------------------------------------------------------------------------
58 typedef enum CryptographicMessageSyntaxAnyId
61 } CryptographicMessageSyntaxAnyId
;
64 /* OBJECT IDENTIFIER */
65 typedef AsnOid ContentType
;
68 typedef AsnOcts SignatureValue
;
71 typedef AsnOcts EncryptedContent
;
74 typedef AsnOcts EncryptedKey
;
77 typedef AsnOcts Digest
;
80 typedef AsnOcts MessageAuthenticationCode
;
82 /* INTEGER { v0 (0), v1 (1), v2 (2), v3 (3), v4 (4) } */
83 class CMSVersion
: public AsnInt
86 CMSVersion(): AsnInt() {}
87 CMSVersion (int i
): AsnInt (i
) {}
100 typedef AsnOcts UserKeyingMaterial
;
103 typedef AsnOcts MessageDigest
;
106 typedef AsnInt RC2ParameterVersion
;
112 typedef AsnBits Signature
;
114 class OriginatorPublicKey
: public AsnType
117 AlgorithmIdentifier
*algorithm
;
120 OriginatorPublicKey();
121 OriginatorPublicKey (const OriginatorPublicKey
&);
122 virtual ~OriginatorPublicKey();
123 virtual AsnType
*Clone() const;
125 virtual AsnType
*Copy() const;
127 OriginatorPublicKey
&operator = (const OriginatorPublicKey
&);
128 AsnLen
BEncContent (BUF_TYPE b
);
129 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
131 AsnLen
BEnc (BUF_TYPE b
);
132 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
133 int BEncPdu (BUF_TYPE b
, AsnLen
&bytesEncoded
);
134 int BDecPdu (BUF_TYPE b
, AsnLen
&bytesDecoded
);
136 void Print (ostream
&os
) const;
140 /* AlgorithmIdentifier */
141 typedef AlgorithmIdentifier DigestAlgorithmIdentifier
;
143 /* AlgorithmIdentifier */
144 typedef AlgorithmIdentifier SignatureAlgorithmIdentifier
;
146 /* AlgorithmIdentifier */
147 typedef AlgorithmIdentifier KeyEncryptionAlgorithmIdentifier
;
149 /* AlgorithmIdentifier */
150 typedef AlgorithmIdentifier ContentEncryptionAlgorithmIdentifier
;
152 /* AlgorithmIdentifier */
153 typedef AlgorithmIdentifier MessageAuthenticationCodeAlgorithm
;
155 class CertificateRevocationLists
: public AsnType
158 unsigned long int count
;
163 CertificateList
*elmt
;
164 } *first
, *curr
, *last
;
167 CertificateRevocationLists() { count
= 0; first
= curr
= last
= NULL
; }
168 CertificateRevocationLists (const CertificateRevocationLists
&);
169 virtual ~CertificateRevocationLists();
170 virtual AsnType
*Clone() const;
172 virtual AsnType
*Copy() const;
174 CertificateRevocationLists
&operator = (const CertificateRevocationLists
&);
175 void SetCurrElmt (unsigned long int index
);
176 unsigned long int GetCurrElmtIndex();
177 void SetCurrToFirst() { curr
= first
; }
178 void SetCurrToLast() { curr
= last
; }
179 // reading member fcns
180 int Count() const { return count
; }
181 // NOTE: if your compiler complains about these NULLs, its definition of NULL is broken (and you better change it there!)
182 CertificateList
*First() const { return count
> 0 ? first
->elmt
: NULL
; }
183 CertificateList
*Last() const { return count
> 0 ? last
->elmt
: NULL
; }
184 CertificateList
*Curr() const { return curr
? curr
->elmt
: NULL
; }
185 CertificateList
*Next() const { return curr
&& curr
->next
? curr
->next
->elmt
: NULL
; }
186 CertificateList
*Prev() const { return curr
&& curr
->prev
? curr
->prev
->elmt
: NULL
; }
188 // routines that move the curr elmt
189 CertificateList
*GoNext() { if (curr
) curr
= curr
->next
; return Curr(); }
190 CertificateList
*GoPrev() { if (curr
) curr
= curr
->prev
; return Curr(); }
192 // write & alloc fcns - returns new elmt
193 CertificateList
*Append(); // add elmt to end of list
194 CertificateList
*Prepend(); // add elmt to beginning of list
195 CertificateList
*InsertBefore(); //insert elmt before current elmt
196 CertificateList
*InsertAfter(); //insert elmt after current elmt
198 // write & alloc & copy - returns list after copying elmt
199 CertificateRevocationLists
&AppendCopy (CertificateList
&elmt
); // add elmt to end of list
200 CertificateRevocationLists
&PrependCopy (CertificateList
&elmt
); // add elmt to beginning of list
201 CertificateRevocationLists
&InsertBeforeAndCopy (CertificateList
&elmt
); //insert elmt before current elmt
202 CertificateRevocationLists
&InsertAfterAndCopy (CertificateList
&elmt
); //insert elmt after current elmt
204 // removing the current elmt from the list
205 void RemoveCurrFromList();
207 // encode and decode routines
208 AsnLen
BEnc (BUF_TYPE b
);
209 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
210 AsnLen
BEncContent (BUF_TYPE b
);
211 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
214 void Print (ostream
&os
) const;
218 class IssuerAndSerialNumber
: public AsnType
222 CertificateSerialNumber serialNumber
;
224 IssuerAndSerialNumber();
225 IssuerAndSerialNumber (const IssuerAndSerialNumber
&);
226 virtual ~IssuerAndSerialNumber();
227 virtual AsnType
*Clone() const;
229 virtual AsnType
*Copy() const;
231 IssuerAndSerialNumber
&operator = (const IssuerAndSerialNumber
&);
232 AsnLen
BEncContent (BUF_TYPE b
);
233 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
235 AsnLen
BEnc (BUF_TYPE b
);
236 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
237 int BEncPdu (BUF_TYPE b
, AsnLen
&bytesEncoded
);
238 int BDecPdu (BUF_TYPE b
, AsnLen
&bytesDecoded
);
240 void Print (ostream
&os
) const;
244 class OtherKeyAttribute
: public AsnType
251 OtherKeyAttribute (const OtherKeyAttribute
&);
252 virtual ~OtherKeyAttribute();
253 virtual AsnType
*Clone() const;
255 virtual AsnType
*Copy() const;
257 OtherKeyAttribute
&operator = (const OtherKeyAttribute
&);
258 AsnLen
BEncContent (BUF_TYPE b
);
259 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
261 AsnLen
BEnc (BUF_TYPE b
);
262 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
263 int BEncPdu (BUF_TYPE b
, AsnLen
&bytesEncoded
);
264 int BDecPdu (BUF_TYPE b
, AsnLen
&bytesDecoded
);
266 void Print (ostream
&os
) const;
270 class DigestAlgorithmIdentifiers
: public AsnType
273 unsigned long int count
;
278 DigestAlgorithmIdentifier
*elmt
;
279 } *first
, *curr
, *last
;
282 DigestAlgorithmIdentifiers() { count
= 0; first
= curr
= last
= NULL
; }
283 DigestAlgorithmIdentifiers (const DigestAlgorithmIdentifiers
&);
284 virtual ~DigestAlgorithmIdentifiers();
285 virtual AsnType
*Clone() const;
287 virtual AsnType
*Copy() const;
289 DigestAlgorithmIdentifiers
&operator = (const DigestAlgorithmIdentifiers
&);
290 void SetCurrElmt (unsigned long int index
);
291 unsigned long int GetCurrElmtIndex();
292 void SetCurrToFirst() { curr
= first
; }
293 void SetCurrToLast() { curr
= last
; }
294 // reading member fcns
295 int Count() const { return count
; }
296 // NOTE: if your compiler complains about these NULLs, its definition of NULL is broken (and you better change it there!)
297 DigestAlgorithmIdentifier
*First() const { return count
> 0 ? first
->elmt
: NULL
; }
298 DigestAlgorithmIdentifier
*Last() const { return count
> 0 ? last
->elmt
: NULL
; }
299 DigestAlgorithmIdentifier
*Curr() const { return curr
? curr
->elmt
: NULL
; }
300 DigestAlgorithmIdentifier
*Next() const { return curr
&& curr
->next
? curr
->next
->elmt
: NULL
; }
301 DigestAlgorithmIdentifier
*Prev() const { return curr
&& curr
->prev
? curr
->prev
->elmt
: NULL
; }
303 // routines that move the curr elmt
304 DigestAlgorithmIdentifier
*GoNext() { if (curr
) curr
= curr
->next
; return Curr(); }
305 DigestAlgorithmIdentifier
*GoPrev() { if (curr
) curr
= curr
->prev
; return Curr(); }
307 // write & alloc fcns - returns new elmt
308 DigestAlgorithmIdentifier
*Append(); // add elmt to end of list
309 DigestAlgorithmIdentifier
*Prepend(); // add elmt to beginning of list
310 DigestAlgorithmIdentifier
*InsertBefore(); //insert elmt before current elmt
311 DigestAlgorithmIdentifier
*InsertAfter(); //insert elmt after current elmt
313 // write & alloc & copy - returns list after copying elmt
314 DigestAlgorithmIdentifiers
&AppendCopy (DigestAlgorithmIdentifier
&elmt
); // add elmt to end of list
315 DigestAlgorithmIdentifiers
&PrependCopy (DigestAlgorithmIdentifier
&elmt
); // add elmt to beginning of list
316 DigestAlgorithmIdentifiers
&InsertBeforeAndCopy (DigestAlgorithmIdentifier
&elmt
); //insert elmt before current elmt
317 DigestAlgorithmIdentifiers
&InsertAfterAndCopy (DigestAlgorithmIdentifier
&elmt
); //insert elmt after current elmt
319 // removing the current elmt from the list
320 void RemoveCurrFromList();
322 // encode and decode routines
323 AsnLen
BEnc (BUF_TYPE b
);
324 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
325 AsnLen
BEncContent (BUF_TYPE b
);
326 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
329 void Print (ostream
&os
) const;
333 class EncapsulatedContentInfo
: public AsnType
336 ContentType eContentType
;
339 EncapsulatedContentInfo();
340 EncapsulatedContentInfo (const EncapsulatedContentInfo
&);
341 virtual ~EncapsulatedContentInfo();
342 virtual AsnType
*Clone() const;
344 virtual AsnType
*Copy() const;
346 EncapsulatedContentInfo
&operator = (const EncapsulatedContentInfo
&);
347 AsnLen
BEncContent (BUF_TYPE b
);
348 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
350 AsnLen
BEnc (BUF_TYPE b
);
351 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
352 int BEncPdu (BUF_TYPE b
, AsnLen
&bytesEncoded
);
353 int BDecPdu (BUF_TYPE b
, AsnLen
&bytesDecoded
);
355 void Print (ostream
&os
) const;
359 class SignerIdentifier
: public AsnType
364 issuerAndSerialNumberCid
= 0,
365 subjectKeyIdentifierCid
= 1
368 enum ChoiceIdEnum choiceId
;
371 IssuerAndSerialNumber
*issuerAndSerialNumber
;
372 KeyIdentifier
*subjectKeyIdentifier
;
377 SignerIdentifier (const SignerIdentifier
&);
378 virtual ~SignerIdentifier();
380 virtual AsnType
*Clone() const;
382 virtual AsnType
*Copy() const;
384 SignerIdentifier
&operator = (const SignerIdentifier
&);
385 AsnLen
BEncContent (BUF_TYPE b
);
386 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
387 AsnLen
BEnc (BUF_TYPE b
);
388 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
389 int BEncPdu (BUF_TYPE b
, AsnLen
&bytesEncoded
);
390 int BDecPdu (BUF_TYPE b
, AsnLen
&bytesDecoded
);
392 void Print (ostream
&os
) const;
396 class EncryptedContentInfo
: public AsnType
399 ContentType contentType
;
400 ContentEncryptionAlgorithmIdentifier
*contentEncryptionAlgorithm
;
401 EncryptedContent
*encryptedContent
;
403 EncryptedContentInfo();
404 EncryptedContentInfo (const EncryptedContentInfo
&);
405 virtual ~EncryptedContentInfo();
406 virtual AsnType
*Clone() const;
408 virtual AsnType
*Copy() const;
410 EncryptedContentInfo
&operator = (const EncryptedContentInfo
&);
411 AsnLen
BEncContent (BUF_TYPE b
);
412 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
414 AsnLen
BEnc (BUF_TYPE b
);
415 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
416 int BEncPdu (BUF_TYPE b
, AsnLen
&bytesEncoded
);
417 int BDecPdu (BUF_TYPE b
, AsnLen
&bytesDecoded
);
419 void Print (ostream
&os
) const;
423 class RecipientIdentifier
: public AsnType
428 issuerAndSerialNumberCid
= 0,
429 subjectKeyIdentifierCid
= 1
432 enum ChoiceIdEnum choiceId
;
435 IssuerAndSerialNumber
*issuerAndSerialNumber
;
436 KeyIdentifier
*subjectKeyIdentifier
;
440 RecipientIdentifier();
441 RecipientIdentifier (const RecipientIdentifier
&);
442 virtual ~RecipientIdentifier();
444 virtual AsnType
*Clone() const;
446 virtual AsnType
*Copy() const;
448 RecipientIdentifier
&operator = (const RecipientIdentifier
&);
449 AsnLen
BEncContent (BUF_TYPE b
);
450 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
451 AsnLen
BEnc (BUF_TYPE b
);
452 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
453 int BEncPdu (BUF_TYPE b
, AsnLen
&bytesEncoded
);
454 int BDecPdu (BUF_TYPE b
, AsnLen
&bytesDecoded
);
456 void Print (ostream
&os
) const;
460 class OriginatorIdentifierOrKey
: public AsnType
465 issuerAndSerialNumberCid
= 0,
466 subjectKeyIdentifierCid
= 1,
470 enum ChoiceIdEnum choiceId
;
473 IssuerAndSerialNumber
*issuerAndSerialNumber
;
474 KeyIdentifier
*subjectKeyIdentifier
;
475 OriginatorPublicKey
*originatorKey
;
479 OriginatorIdentifierOrKey();
480 OriginatorIdentifierOrKey (const OriginatorIdentifierOrKey
&);
481 virtual ~OriginatorIdentifierOrKey();
483 virtual AsnType
*Clone() const;
485 virtual AsnType
*Copy() const;
487 OriginatorIdentifierOrKey
&operator = (const OriginatorIdentifierOrKey
&);
488 AsnLen
BEncContent (BUF_TYPE b
);
489 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
490 AsnLen
BEnc (BUF_TYPE b
);
491 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
492 int BEncPdu (BUF_TYPE b
, AsnLen
&bytesEncoded
);
493 int BDecPdu (BUF_TYPE b
, AsnLen
&bytesDecoded
);
495 void Print (ostream
&os
) const;
499 class RecipientKeyIdentifier
: public AsnType
502 KeyIdentifier subjectKeyIdentifier
;
503 GeneralizedTime
*date
;
504 OtherKeyAttribute
*other
;
506 RecipientKeyIdentifier();
507 RecipientKeyIdentifier (const RecipientKeyIdentifier
&);
508 virtual ~RecipientKeyIdentifier();
509 virtual AsnType
*Clone() const;
511 virtual AsnType
*Copy() const;
513 RecipientKeyIdentifier
&operator = (const RecipientKeyIdentifier
&);
514 AsnLen
BEncContent (BUF_TYPE b
);
515 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
517 AsnLen
BEnc (BUF_TYPE b
);
518 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
519 int BEncPdu (BUF_TYPE b
, AsnLen
&bytesEncoded
);
520 int BDecPdu (BUF_TYPE b
, AsnLen
&bytesDecoded
);
522 void Print (ostream
&os
) const;
526 class KEKIdentifier
: public AsnType
529 AsnOcts keyIdentifier
;
530 GeneralizedTime
*date
;
531 OtherKeyAttribute
*other
;
534 KEKIdentifier (const KEKIdentifier
&);
535 virtual ~KEKIdentifier();
536 virtual AsnType
*Clone() const;
538 virtual AsnType
*Copy() const;
540 KEKIdentifier
&operator = (const KEKIdentifier
&);
541 AsnLen
BEncContent (BUF_TYPE b
);
542 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
544 AsnLen
BEnc (BUF_TYPE b
);
545 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
546 int BEncPdu (BUF_TYPE b
, AsnLen
&bytesEncoded
);
547 int BDecPdu (BUF_TYPE b
, AsnLen
&bytesDecoded
);
549 void Print (ostream
&os
) const;
553 class ExtendedCertificateInfo
: public AsnType
557 Certificate
*certificate
;
558 Attributes attributes
;
560 ExtendedCertificateInfo();
561 ExtendedCertificateInfo (const ExtendedCertificateInfo
&);
562 virtual ~ExtendedCertificateInfo();
563 virtual AsnType
*Clone() const;
565 virtual AsnType
*Copy() const;
567 ExtendedCertificateInfo
&operator = (const ExtendedCertificateInfo
&);
568 AsnLen
BEncContent (BUF_TYPE b
);
569 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
571 AsnLen
BEnc (BUF_TYPE b
);
572 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
573 int BEncPdu (BUF_TYPE b
, AsnLen
&bytesEncoded
);
574 int BDecPdu (BUF_TYPE b
, AsnLen
&bytesDecoded
);
576 void Print (ostream
&os
) const;
580 class SignerInfo
: public AsnType
584 SignerIdentifier
*sid
;
585 DigestAlgorithmIdentifier
*digestAlgorithm
;
586 Attributes
*signedAttrs
;
587 SignatureAlgorithmIdentifier
*signatureAlgorithm
;
588 SignatureValue signature
;
589 Attributes
*unsignedAttrs
;
592 SignerInfo (const SignerInfo
&);
593 virtual ~SignerInfo();
594 virtual AsnType
*Clone() const;
596 virtual AsnType
*Copy() const;
598 SignerInfo
&operator = (const SignerInfo
&);
599 AsnLen
BEncContent (BUF_TYPE b
);
600 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
602 AsnLen
BEnc (BUF_TYPE b
);
603 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
604 int BEncPdu (BUF_TYPE b
, AsnLen
&bytesEncoded
);
605 int BDecPdu (BUF_TYPE b
, AsnLen
&bytesDecoded
);
607 void Print (ostream
&os
) const;
611 class KeyTransRecipientInfo
: public AsnType
615 RecipientIdentifier
*rid
;
616 KeyEncryptionAlgorithmIdentifier
*keyEncryptionAlgorithm
;
617 EncryptedKey encryptedKey
;
619 KeyTransRecipientInfo();
620 KeyTransRecipientInfo (const KeyTransRecipientInfo
&);
621 virtual ~KeyTransRecipientInfo();
622 virtual AsnType
*Clone() const;
624 virtual AsnType
*Copy() const;
626 KeyTransRecipientInfo
&operator = (const KeyTransRecipientInfo
&);
627 AsnLen
BEncContent (BUF_TYPE b
);
628 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
630 AsnLen
BEnc (BUF_TYPE b
);
631 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
632 int BEncPdu (BUF_TYPE b
, AsnLen
&bytesEncoded
);
633 int BDecPdu (BUF_TYPE b
, AsnLen
&bytesDecoded
);
635 void Print (ostream
&os
) const;
639 class KeyAgreeRecipientIdentifier
: public AsnType
644 issuerAndSerialNumberCid
= 0,
648 enum ChoiceIdEnum choiceId
;
651 IssuerAndSerialNumber
*issuerAndSerialNumber
;
652 RecipientKeyIdentifier
*rKeyId
;
656 KeyAgreeRecipientIdentifier();
657 KeyAgreeRecipientIdentifier (const KeyAgreeRecipientIdentifier
&);
658 virtual ~KeyAgreeRecipientIdentifier();
660 virtual AsnType
*Clone() const;
662 virtual AsnType
*Copy() const;
664 KeyAgreeRecipientIdentifier
&operator = (const KeyAgreeRecipientIdentifier
&);
665 AsnLen
BEncContent (BUF_TYPE b
);
666 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
667 AsnLen
BEnc (BUF_TYPE b
);
668 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
669 int BEncPdu (BUF_TYPE b
, AsnLen
&bytesEncoded
);
670 int BDecPdu (BUF_TYPE b
, AsnLen
&bytesDecoded
);
672 void Print (ostream
&os
) const;
676 class KEKRecipientInfo
: public AsnType
680 KEKIdentifier
*kekid
;
681 KeyEncryptionAlgorithmIdentifier
*keyEncryptionAlgorithm
;
682 EncryptedKey encryptedKey
;
685 KEKRecipientInfo (const KEKRecipientInfo
&);
686 virtual ~KEKRecipientInfo();
687 virtual AsnType
*Clone() const;
689 virtual AsnType
*Copy() const;
691 KEKRecipientInfo
&operator = (const KEKRecipientInfo
&);
692 AsnLen
BEncContent (BUF_TYPE b
);
693 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
695 AsnLen
BEnc (BUF_TYPE b
);
696 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
697 int BEncPdu (BUF_TYPE b
, AsnLen
&bytesEncoded
);
698 int BDecPdu (BUF_TYPE b
, AsnLen
&bytesDecoded
);
700 void Print (ostream
&os
) const;
704 class ExtendedCertificate
: public AsnType
707 ExtendedCertificateInfo
*extendedCertificateInfo
;
708 SignatureAlgorithmIdentifier
*signatureAlgorithm
;
711 ExtendedCertificate();
712 ExtendedCertificate (const ExtendedCertificate
&);
713 virtual ~ExtendedCertificate();
714 virtual AsnType
*Clone() const;
716 virtual AsnType
*Copy() const;
718 ExtendedCertificate
&operator = (const ExtendedCertificate
&);
719 AsnLen
BEncContent (BUF_TYPE b
);
720 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
722 AsnLen
BEnc (BUF_TYPE b
);
723 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
724 int BEncPdu (BUF_TYPE b
, AsnLen
&bytesEncoded
);
725 int BDecPdu (BUF_TYPE b
, AsnLen
&bytesDecoded
);
727 void Print (ostream
&os
) const;
731 class SignerInfos
: public AsnType
734 unsigned long int count
;
740 } *first
, *curr
, *last
;
743 SignerInfos() { count
= 0; first
= curr
= last
= NULL
; }
744 SignerInfos (const SignerInfos
&);
745 virtual ~SignerInfos();
746 virtual AsnType
*Clone() const;
748 virtual AsnType
*Copy() const;
750 SignerInfos
&operator = (const SignerInfos
&);
751 void SetCurrElmt (unsigned long int index
);
752 unsigned long int GetCurrElmtIndex();
753 void SetCurrToFirst() { curr
= first
; }
754 void SetCurrToLast() { curr
= last
; }
755 // reading member fcns
756 int Count() const { return count
; }
757 // NOTE: if your compiler complains about these NULLs, its definition of NULL is broken (and you better change it there!)
758 SignerInfo
*First() const { return count
> 0 ? first
->elmt
: NULL
; }
759 SignerInfo
*Last() const { return count
> 0 ? last
->elmt
: NULL
; }
760 SignerInfo
*Curr() const { return curr
? curr
->elmt
: NULL
; }
761 SignerInfo
*Next() const { return curr
&& curr
->next
? curr
->next
->elmt
: NULL
; }
762 SignerInfo
*Prev() const { return curr
&& curr
->prev
? curr
->prev
->elmt
: NULL
; }
764 // routines that move the curr elmt
765 SignerInfo
*GoNext() { if (curr
) curr
= curr
->next
; return Curr(); }
766 SignerInfo
*GoPrev() { if (curr
) curr
= curr
->prev
; return Curr(); }
768 // write & alloc fcns - returns new elmt
769 SignerInfo
*Append(); // add elmt to end of list
770 SignerInfo
*Prepend(); // add elmt to beginning of list
771 SignerInfo
*InsertBefore(); //insert elmt before current elmt
772 SignerInfo
*InsertAfter(); //insert elmt after current elmt
774 // write & alloc & copy - returns list after copying elmt
775 SignerInfos
&AppendCopy (SignerInfo
&elmt
); // add elmt to end of list
776 SignerInfos
&PrependCopy (SignerInfo
&elmt
); // add elmt to beginning of list
777 SignerInfos
&InsertBeforeAndCopy (SignerInfo
&elmt
); //insert elmt before current elmt
778 SignerInfos
&InsertAfterAndCopy (SignerInfo
&elmt
); //insert elmt after current elmt
780 // removing the current elmt from the list
781 void RemoveCurrFromList();
783 // encode and decode routines
784 AsnLen
BEnc (BUF_TYPE b
);
785 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
786 AsnLen
BEncContent (BUF_TYPE b
);
787 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
790 void Print (ostream
&os
) const;
794 class RecipientEncryptedKey
: public AsnType
797 KeyAgreeRecipientIdentifier
*rid
;
798 EncryptedKey encryptedKey
;
800 RecipientEncryptedKey();
801 RecipientEncryptedKey (const RecipientEncryptedKey
&);
802 virtual ~RecipientEncryptedKey();
803 virtual AsnType
*Clone() const;
805 virtual AsnType
*Copy() const;
807 RecipientEncryptedKey
&operator = (const RecipientEncryptedKey
&);
808 AsnLen
BEncContent (BUF_TYPE b
);
809 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
811 AsnLen
BEnc (BUF_TYPE b
);
812 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
813 int BEncPdu (BUF_TYPE b
, AsnLen
&bytesEncoded
);
814 int BDecPdu (BUF_TYPE b
, AsnLen
&bytesDecoded
);
816 void Print (ostream
&os
) const;
820 class CertificateChoices
: public AsnType
826 extendedCertificateCid
= 1,
830 enum ChoiceIdEnum choiceId
;
833 Certificate
*certificate
;
834 ExtendedCertificate
*extendedCertificate
;
835 AttributeCertificate
*attrCert
;
839 CertificateChoices();
840 CertificateChoices (const CertificateChoices
&);
841 virtual ~CertificateChoices();
843 virtual AsnType
*Clone() const;
845 virtual AsnType
*Copy() const;
847 CertificateChoices
&operator = (const CertificateChoices
&);
848 AsnLen
BEncContent (BUF_TYPE b
);
849 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
850 AsnLen
BEnc (BUF_TYPE b
);
851 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
852 int BEncPdu (BUF_TYPE b
, AsnLen
&bytesEncoded
);
853 int BDecPdu (BUF_TYPE b
, AsnLen
&bytesDecoded
);
855 void Print (ostream
&os
) const;
859 class CertificateSet
: public AsnType
862 unsigned long int count
;
867 CertificateChoices
*elmt
;
868 } *first
, *curr
, *last
;
871 CertificateSet() { count
= 0; first
= curr
= last
= NULL
; }
872 CertificateSet (const CertificateSet
&);
873 virtual ~CertificateSet();
874 virtual AsnType
*Clone() const;
876 virtual AsnType
*Copy() const;
878 CertificateSet
&operator = (const CertificateSet
&);
879 void SetCurrElmt (unsigned long int index
);
880 unsigned long int GetCurrElmtIndex();
881 void SetCurrToFirst() { curr
= first
; }
882 void SetCurrToLast() { curr
= last
; }
883 // reading member fcns
884 int Count() const { return count
; }
885 // NOTE: if your compiler complains about these NULLs, its definition of NULL is broken (and you better change it there!)
886 CertificateChoices
*First() const { return count
> 0 ? first
->elmt
: NULL
; }
887 CertificateChoices
*Last() const { return count
> 0 ? last
->elmt
: NULL
; }
888 CertificateChoices
*Curr() const { return curr
? curr
->elmt
: NULL
; }
889 CertificateChoices
*Next() const { return curr
&& curr
->next
? curr
->next
->elmt
: NULL
; }
890 CertificateChoices
*Prev() const { return curr
&& curr
->prev
? curr
->prev
->elmt
: NULL
; }
892 // routines that move the curr elmt
893 CertificateChoices
*GoNext() { if (curr
) curr
= curr
->next
; return Curr(); }
894 CertificateChoices
*GoPrev() { if (curr
) curr
= curr
->prev
; return Curr(); }
896 // write & alloc fcns - returns new elmt
897 CertificateChoices
*Append(); // add elmt to end of list
898 CertificateChoices
*Prepend(); // add elmt to beginning of list
899 CertificateChoices
*InsertBefore(); //insert elmt before current elmt
900 CertificateChoices
*InsertAfter(); //insert elmt after current elmt
902 // write & alloc & copy - returns list after copying elmt
903 CertificateSet
&AppendCopy (CertificateChoices
&elmt
); // add elmt to end of list
904 CertificateSet
&PrependCopy (CertificateChoices
&elmt
); // add elmt to beginning of list
905 CertificateSet
&InsertBeforeAndCopy (CertificateChoices
&elmt
); //insert elmt before current elmt
906 CertificateSet
&InsertAfterAndCopy (CertificateChoices
&elmt
); //insert elmt after current elmt
908 // removing the current elmt from the list
909 void RemoveCurrFromList();
911 // encode and decode routines
912 AsnLen
BEnc (BUF_TYPE b
);
913 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
914 AsnLen
BEncContent (BUF_TYPE b
);
915 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
918 void Print (ostream
&os
) const;
922 class OriginatorInfo
: public AsnType
925 CertificateSet
*certs
;
926 CertificateRevocationLists
*crls
;
929 OriginatorInfo (const OriginatorInfo
&);
930 virtual ~OriginatorInfo();
931 virtual AsnType
*Clone() const;
933 virtual AsnType
*Copy() const;
935 OriginatorInfo
&operator = (const OriginatorInfo
&);
936 AsnLen
BEncContent (BUF_TYPE b
);
937 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
939 AsnLen
BEnc (BUF_TYPE b
);
940 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
941 int BEncPdu (BUF_TYPE b
, AsnLen
&bytesEncoded
);
942 int BDecPdu (BUF_TYPE b
, AsnLen
&bytesDecoded
);
944 void Print (ostream
&os
) const;
948 class RecipientEncryptedKeys
: public AsnType
951 unsigned long int count
;
956 RecipientEncryptedKey
*elmt
;
957 } *first
, *curr
, *last
;
960 RecipientEncryptedKeys() { count
= 0; first
= curr
= last
= NULL
; }
961 RecipientEncryptedKeys (const RecipientEncryptedKeys
&);
962 virtual ~RecipientEncryptedKeys();
963 virtual AsnType
*Clone() const;
965 virtual AsnType
*Copy() const;
967 RecipientEncryptedKeys
&operator = (const RecipientEncryptedKeys
&);
968 void SetCurrElmt (unsigned long int index
);
969 unsigned long int GetCurrElmtIndex();
970 void SetCurrToFirst() { curr
= first
; }
971 void SetCurrToLast() { curr
= last
; }
972 // reading member fcns
973 int Count() const { return count
; }
974 // NOTE: if your compiler complains about these NULLs, its definition of NULL is broken (and you better change it there!)
975 RecipientEncryptedKey
*First() const { return count
> 0 ? first
->elmt
: NULL
; }
976 RecipientEncryptedKey
*Last() const { return count
> 0 ? last
->elmt
: NULL
; }
977 RecipientEncryptedKey
*Curr() const { return curr
? curr
->elmt
: NULL
; }
978 RecipientEncryptedKey
*Next() const { return curr
&& curr
->next
? curr
->next
->elmt
: NULL
; }
979 RecipientEncryptedKey
*Prev() const { return curr
&& curr
->prev
? curr
->prev
->elmt
: NULL
; }
981 // routines that move the curr elmt
982 RecipientEncryptedKey
*GoNext() { if (curr
) curr
= curr
->next
; return Curr(); }
983 RecipientEncryptedKey
*GoPrev() { if (curr
) curr
= curr
->prev
; return Curr(); }
985 // write & alloc fcns - returns new elmt
986 RecipientEncryptedKey
*Append(); // add elmt to end of list
987 RecipientEncryptedKey
*Prepend(); // add elmt to beginning of list
988 RecipientEncryptedKey
*InsertBefore(); //insert elmt before current elmt
989 RecipientEncryptedKey
*InsertAfter(); //insert elmt after current elmt
991 // write & alloc & copy - returns list after copying elmt
992 RecipientEncryptedKeys
&AppendCopy (RecipientEncryptedKey
&elmt
); // add elmt to end of list
993 RecipientEncryptedKeys
&PrependCopy (RecipientEncryptedKey
&elmt
); // add elmt to beginning of list
994 RecipientEncryptedKeys
&InsertBeforeAndCopy (RecipientEncryptedKey
&elmt
); //insert elmt before current elmt
995 RecipientEncryptedKeys
&InsertAfterAndCopy (RecipientEncryptedKey
&elmt
); //insert elmt after current elmt
997 // removing the current elmt from the list
998 void RemoveCurrFromList();
1000 // encode and decode routines
1001 AsnLen
BEnc (BUF_TYPE b
);
1002 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
1003 AsnLen
BEncContent (BUF_TYPE b
);
1004 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
1007 void Print (ostream
&os
) const;
1011 class KeyAgreeRecipientInfo
: public AsnType
1015 OriginatorIdentifierOrKey
*originator
;
1016 UserKeyingMaterial
*ukm
;
1017 KeyEncryptionAlgorithmIdentifier
*keyEncryptionAlgorithm
;
1018 RecipientEncryptedKeys recipientEncryptedKeys
;
1020 KeyAgreeRecipientInfo();
1021 KeyAgreeRecipientInfo (const KeyAgreeRecipientInfo
&);
1022 virtual ~KeyAgreeRecipientInfo();
1023 virtual AsnType
*Clone() const;
1025 virtual AsnType
*Copy() const;
1027 KeyAgreeRecipientInfo
&operator = (const KeyAgreeRecipientInfo
&);
1028 AsnLen
BEncContent (BUF_TYPE b
);
1029 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
1031 AsnLen
BEnc (BUF_TYPE b
);
1032 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
1033 int BEncPdu (BUF_TYPE b
, AsnLen
&bytesEncoded
);
1034 int BDecPdu (BUF_TYPE b
, AsnLen
&bytesDecoded
);
1036 void Print (ostream
&os
) const;
1040 class RecipientInfo
: public AsnType
1050 enum ChoiceIdEnum choiceId
;
1053 KeyTransRecipientInfo
*ktri
;
1054 KeyAgreeRecipientInfo
*kari
;
1055 KEKRecipientInfo
*kekri
;
1060 RecipientInfo (const RecipientInfo
&);
1061 virtual ~RecipientInfo();
1063 virtual AsnType
*Clone() const;
1065 virtual AsnType
*Copy() const;
1067 RecipientInfo
&operator = (const RecipientInfo
&);
1068 AsnLen
BEncContent (BUF_TYPE b
);
1069 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
1070 AsnLen
BEnc (BUF_TYPE b
);
1071 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
1072 int BEncPdu (BUF_TYPE b
, AsnLen
&bytesEncoded
);
1073 int BDecPdu (BUF_TYPE b
, AsnLen
&bytesDecoded
);
1075 void Print (ostream
&os
) const;
1079 class RecipientInfos
: public AsnType
1082 unsigned long int count
;
1087 RecipientInfo
*elmt
;
1088 } *first
, *curr
, *last
;
1091 RecipientInfos() { count
= 0; first
= curr
= last
= NULL
; }
1092 RecipientInfos (const RecipientInfos
&);
1093 virtual ~RecipientInfos();
1094 virtual AsnType
*Clone() const;
1096 virtual AsnType
*Copy() const;
1098 RecipientInfos
&operator = (const RecipientInfos
&);
1099 void SetCurrElmt (unsigned long int index
);
1100 unsigned long int GetCurrElmtIndex();
1101 void SetCurrToFirst() { curr
= first
; }
1102 void SetCurrToLast() { curr
= last
; }
1103 // reading member fcns
1104 int Count() const { return count
; }
1105 // NOTE: if your compiler complains about these NULLs, its definition of NULL is broken (and you better change it there!)
1106 RecipientInfo
*First() const { return count
> 0 ? first
->elmt
: NULL
; }
1107 RecipientInfo
*Last() const { return count
> 0 ? last
->elmt
: NULL
; }
1108 RecipientInfo
*Curr() const { return curr
? curr
->elmt
: NULL
; }
1109 RecipientInfo
*Next() const { return curr
&& curr
->next
? curr
->next
->elmt
: NULL
; }
1110 RecipientInfo
*Prev() const { return curr
&& curr
->prev
? curr
->prev
->elmt
: NULL
; }
1112 // routines that move the curr elmt
1113 RecipientInfo
*GoNext() { if (curr
) curr
= curr
->next
; return Curr(); }
1114 RecipientInfo
*GoPrev() { if (curr
) curr
= curr
->prev
; return Curr(); }
1116 // write & alloc fcns - returns new elmt
1117 RecipientInfo
*Append(); // add elmt to end of list
1118 RecipientInfo
*Prepend(); // add elmt to beginning of list
1119 RecipientInfo
*InsertBefore(); //insert elmt before current elmt
1120 RecipientInfo
*InsertAfter(); //insert elmt after current elmt
1122 // write & alloc & copy - returns list after copying elmt
1123 RecipientInfos
&AppendCopy (RecipientInfo
&elmt
); // add elmt to end of list
1124 RecipientInfos
&PrependCopy (RecipientInfo
&elmt
); // add elmt to beginning of list
1125 RecipientInfos
&InsertBeforeAndCopy (RecipientInfo
&elmt
); //insert elmt before current elmt
1126 RecipientInfos
&InsertAfterAndCopy (RecipientInfo
&elmt
); //insert elmt after current elmt
1128 // removing the current elmt from the list
1129 void RemoveCurrFromList();
1131 // encode and decode routines
1132 AsnLen
BEnc (BUF_TYPE b
);
1133 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
1134 AsnLen
BEncContent (BUF_TYPE b
);
1135 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
1138 void Print (ostream
&os
) const;
1142 class ContentInfo
: public AsnType
1145 ContentType contentType
;
1149 ContentInfo (const ContentInfo
&);
1150 virtual ~ContentInfo();
1151 virtual AsnType
*Clone() const;
1153 virtual AsnType
*Copy() const;
1155 ContentInfo
&operator = (const ContentInfo
&);
1156 AsnLen
BEncContent (BUF_TYPE b
);
1157 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
1159 AsnLen
BEnc (BUF_TYPE b
);
1160 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
1161 int BEncPdu (BUF_TYPE b
, AsnLen
&bytesEncoded
);
1162 int BDecPdu (BUF_TYPE b
, AsnLen
&bytesDecoded
);
1164 void Print (ostream
&os
) const;
1168 class SignedData
: public AsnType
1172 DigestAlgorithmIdentifiers digestAlgorithms
;
1173 EncapsulatedContentInfo
*encapContentInfo
;
1174 CertificateSet
*certificates
;
1175 CertificateRevocationLists
*crls
;
1176 SignerInfos signerInfos
;
1179 SignedData (const SignedData
&);
1180 virtual ~SignedData();
1181 virtual AsnType
*Clone() const;
1183 virtual AsnType
*Copy() const;
1185 SignedData
&operator = (const SignedData
&);
1186 AsnLen
BEncContent (BUF_TYPE b
);
1187 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
1189 AsnLen
BEnc (BUF_TYPE b
);
1190 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
1191 int BEncPdu (BUF_TYPE b
, AsnLen
&bytesEncoded
);
1192 int BDecPdu (BUF_TYPE b
, AsnLen
&bytesDecoded
);
1194 void Print (ostream
&os
) const;
1198 class EnvelopedData
: public AsnType
1202 OriginatorInfo
*originatorInfo
;
1203 RecipientInfos recipientInfos
;
1204 EncryptedContentInfo
*encryptedContentInfo
;
1205 Attributes
*unprotectedAttrs
;
1208 EnvelopedData (const EnvelopedData
&);
1209 virtual ~EnvelopedData();
1210 virtual AsnType
*Clone() const;
1212 virtual AsnType
*Copy() const;
1214 EnvelopedData
&operator = (const EnvelopedData
&);
1215 AsnLen
BEncContent (BUF_TYPE b
);
1216 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
1218 AsnLen
BEnc (BUF_TYPE b
);
1219 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
1220 int BEncPdu (BUF_TYPE b
, AsnLen
&bytesEncoded
);
1221 int BDecPdu (BUF_TYPE b
, AsnLen
&bytesDecoded
);
1223 void Print (ostream
&os
) const;
1227 class DigestedData
: public AsnType
1231 DigestAlgorithmIdentifier
*digestAlgorithm
;
1232 EncapsulatedContentInfo
*encapContentInfo
;
1236 DigestedData (const DigestedData
&);
1237 virtual ~DigestedData();
1238 virtual AsnType
*Clone() const;
1240 virtual AsnType
*Copy() const;
1242 DigestedData
&operator = (const DigestedData
&);
1243 AsnLen
BEncContent (BUF_TYPE b
);
1244 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
1246 AsnLen
BEnc (BUF_TYPE b
);
1247 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
1248 int BEncPdu (BUF_TYPE b
, AsnLen
&bytesEncoded
);
1249 int BDecPdu (BUF_TYPE b
, AsnLen
&bytesDecoded
);
1251 void Print (ostream
&os
) const;
1255 class EncryptedData
: public AsnType
1259 EncryptedContentInfo
*encryptedContentInfo
;
1262 EncryptedData (const EncryptedData
&);
1263 virtual ~EncryptedData();
1264 virtual AsnType
*Clone() const;
1266 virtual AsnType
*Copy() const;
1268 EncryptedData
&operator = (const EncryptedData
&);
1269 AsnLen
BEncContent (BUF_TYPE b
);
1270 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
1272 AsnLen
BEnc (BUF_TYPE b
);
1273 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
1274 int BEncPdu (BUF_TYPE b
, AsnLen
&bytesEncoded
);
1275 int BDecPdu (BUF_TYPE b
, AsnLen
&bytesDecoded
);
1277 void Print (ostream
&os
) const;
1281 class AuthenticatedData
: public AsnType
1285 OriginatorInfo
*originatorInfo
;
1286 RecipientInfos recipientInfos
;
1287 MessageAuthenticationCodeAlgorithm
*macAlgorithm
;
1288 DigestAlgorithmIdentifier
*digestAlgorithm
;
1289 EncapsulatedContentInfo
*encapContentInfo
;
1290 Attributes
*authenctiatedAttributes
;
1291 MessageAuthenticationCode mac
;
1292 Attributes
*unauthenticatedAttributes
;
1294 AuthenticatedData();
1295 AuthenticatedData (const AuthenticatedData
&);
1296 virtual ~AuthenticatedData();
1297 virtual AsnType
*Clone() const;
1299 virtual AsnType
*Copy() const;
1301 AuthenticatedData
&operator = (const AuthenticatedData
&);
1302 AsnLen
BEncContent (BUF_TYPE b
);
1303 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
1305 AsnLen
BEnc (BUF_TYPE b
);
1306 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
1307 int BEncPdu (BUF_TYPE b
, AsnLen
&bytesEncoded
);
1308 int BDecPdu (BUF_TYPE b
, AsnLen
&bytesDecoded
);
1310 void Print (ostream
&os
) const;
1314 class UserKeyingMaterials
: public AsnType
1317 unsigned long int count
;
1322 UserKeyingMaterial
*elmt
;
1323 } *first
, *curr
, *last
;
1326 UserKeyingMaterials() { count
= 0; first
= curr
= last
= NULL
; }
1327 UserKeyingMaterials (const UserKeyingMaterials
&);
1328 virtual ~UserKeyingMaterials();
1329 virtual AsnType
*Clone() const;
1331 virtual AsnType
*Copy() const;
1333 UserKeyingMaterials
&operator = (const UserKeyingMaterials
&);
1334 void SetCurrElmt (unsigned long int index
);
1335 unsigned long int GetCurrElmtIndex();
1336 void SetCurrToFirst() { curr
= first
; }
1337 void SetCurrToLast() { curr
= last
; }
1338 // reading member fcns
1339 int Count() const { return count
; }
1340 // NOTE: if your compiler complains about these NULLs, its definition of NULL is broken (and you better change it there!)
1341 UserKeyingMaterial
*First() const { return count
> 0 ? first
->elmt
: NULL
; }
1342 UserKeyingMaterial
*Last() const { return count
> 0 ? last
->elmt
: NULL
; }
1343 UserKeyingMaterial
*Curr() const { return curr
? curr
->elmt
: NULL
; }
1344 UserKeyingMaterial
*Next() const { return curr
&& curr
->next
? curr
->next
->elmt
: NULL
; }
1345 UserKeyingMaterial
*Prev() const { return curr
&& curr
->prev
? curr
->prev
->elmt
: NULL
; }
1347 // routines that move the curr elmt
1348 UserKeyingMaterial
*GoNext() { if (curr
) curr
= curr
->next
; return Curr(); }
1349 UserKeyingMaterial
*GoPrev() { if (curr
) curr
= curr
->prev
; return Curr(); }
1351 // write & alloc fcns - returns new elmt
1352 UserKeyingMaterial
*Append(); // add elmt to end of list
1353 UserKeyingMaterial
*Prepend(); // add elmt to beginning of list
1354 UserKeyingMaterial
*InsertBefore(); //insert elmt before current elmt
1355 UserKeyingMaterial
*InsertAfter(); //insert elmt after current elmt
1357 // write & alloc & copy - returns list after copying elmt
1358 UserKeyingMaterials
&AppendCopy (UserKeyingMaterial
&elmt
); // add elmt to end of list
1359 UserKeyingMaterials
&PrependCopy (UserKeyingMaterial
&elmt
); // add elmt to beginning of list
1360 UserKeyingMaterials
&InsertBeforeAndCopy (UserKeyingMaterial
&elmt
); //insert elmt before current elmt
1361 UserKeyingMaterials
&InsertAfterAndCopy (UserKeyingMaterial
&elmt
); //insert elmt after current elmt
1363 // removing the current elmt from the list
1364 void RemoveCurrFromList();
1366 // encode and decode routines
1367 AsnLen
BEnc (BUF_TYPE b
);
1368 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
1369 AsnLen
BEncContent (BUF_TYPE b
);
1370 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
1373 void Print (ostream
&os
) const;
1378 typedef Time SigningTime
;
1381 typedef SignerInfo Countersignature
;
1383 /* AlgorithmIdentifier */
1384 typedef AlgorithmIdentifier KeyWrapAlgorithm
;
1386 /* RC2ParameterVersion */
1387 typedef RC2ParameterVersion RC2wrapParameter
;
1390 typedef IV CBCParameter
;
1392 class RC2CBCParameter
: public AsnType
1395 AsnInt rc2ParameterVersion
;
1399 RC2CBCParameter (const RC2CBCParameter
&);
1400 virtual ~RC2CBCParameter();
1401 virtual AsnType
*Clone() const;
1403 virtual AsnType
*Copy() const;
1405 RC2CBCParameter
&operator = (const RC2CBCParameter
&);
1406 AsnLen
BEncContent (BUF_TYPE b
);
1407 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
1409 AsnLen
BEnc (BUF_TYPE b
);
1410 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
1411 int BEncPdu (BUF_TYPE b
, AsnLen
&bytesEncoded
);
1412 int BDecPdu (BUF_TYPE b
, AsnLen
&bytesDecoded
);
1414 void Print (ostream
&os
) const;
1418 class ExtendedCertificateOrCertificate
: public AsnType
1424 extendedCertificateCid
= 1
1427 enum ChoiceIdEnum choiceId
;
1430 Certificate
*certificate
;
1431 ExtendedCertificate
*extendedCertificate
;
1435 ExtendedCertificateOrCertificate();
1436 ExtendedCertificateOrCertificate (const ExtendedCertificateOrCertificate
&);
1437 virtual ~ExtendedCertificateOrCertificate();
1439 virtual AsnType
*Clone() const;
1441 virtual AsnType
*Copy() const;
1443 ExtendedCertificateOrCertificate
&operator = (const ExtendedCertificateOrCertificate
&);
1444 AsnLen
BEncContent (BUF_TYPE b
);
1445 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
1446 AsnLen
BEnc (BUF_TYPE b
);
1447 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
1448 int BEncPdu (BUF_TYPE b
, AsnLen
&bytesEncoded
);
1449 int BDecPdu (BUF_TYPE b
, AsnLen
&bytesDecoded
);
1451 void Print (ostream
&os
) const;
1455 class DigestInfo
: public AsnType
1458 DigestAlgorithmIdentifier
*digestAlgorithm
;
1462 DigestInfo (const DigestInfo
&);
1463 virtual ~DigestInfo();
1464 virtual AsnType
*Clone() const;
1466 virtual AsnType
*Copy() const;
1468 DigestInfo
&operator = (const DigestInfo
&);
1469 AsnLen
BEncContent (BUF_TYPE b
);
1470 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
1472 AsnLen
BEnc (BUF_TYPE b
);
1473 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
1474 int BEncPdu (BUF_TYPE b
, AsnLen
&bytesEncoded
);
1475 int BDecPdu (BUF_TYPE b
, AsnLen
&bytesDecoded
);
1477 void Print (ostream
&os
) const;
1481 //------------------------------------------------------------------------------
1482 // externs for value defs
1484 #define sha_1_arc 1, 3, 14, 3, 2, 26
1485 #define sha_1 AsnOid(sha_1_arc)
1486 #define id_dsa_with_sha1_arc 1, 2, 840, 10040, 4, 3
1487 #define id_dsa_with_sha1 AsnOid(id_dsa_with_sha1_arc)
1488 #define dh_public_number_arc 1, 2, 840, 10046, 2, 1
1489 #define dh_public_number AsnOid(dh_public_number_arc)
1490 #define id_alg_ESDH_arc 1, 2, 840, 113549, 1, 9, 16, 3, 5
1491 #define id_alg_ESDH AsnOid(id_alg_ESDH_arc)
1492 #define id_alg_CMS3DESwrap_arc 1, 2, 840, 113549, 1, 9, 16, 3, 6
1493 #define id_alg_CMS3DESwrap AsnOid(id_alg_CMS3DESwrap_arc)
1494 #define id_alg_CMSRC2wrap_arc 1, 2, 840, 113549, 1, 9, 16, 3, 7
1495 #define id_alg_CMSRC2wrap AsnOid(id_alg_CMSRC2wrap_arc)
1496 #define des_ede3_cbc_arc 1, 2, 840, 113549, 3, 7
1497 #define des_ede3_cbc AsnOid(des_ede3_cbc_arc)
1498 #define rc2_cbc_arc 1, 2, 840, 113549, 3, 2
1499 #define rc2_cbc AsnOid(rc2_cbc_arc)
1500 #define hMAC_SHA1_arc 1, 3, 6, 1, 5, 5, 8, 1, 2
1501 #define hMAC_SHA1 AsnOid(hMAC_SHA1_arc)
1502 #define rc2_ecb_arc 1, 2, 840, 113549, 3, 3
1503 #define rc2_ecb AsnOid(rc2_ecb_arc)
1504 #define rc4_arc 1, 2, 840, 113549, 3, 4
1505 #define rc4 AsnOid(rc4_arc)
1506 #define rc4WithMAC_arc 1, 2, 840, 113549, 3, 5
1507 #define rc4WithMAC AsnOid(rc4WithMAC_arc)
1508 #define desx_CBC_arc 1, 2, 840, 113549, 3, 6
1509 #define desx_CBC AsnOid(desx_CBC_arc)
1510 #define rc5CBC_arc 1, 2, 840, 113549, 3, 8
1511 #define rc5CBC AsnOid(rc5CBC_arc)
1512 #define rc5_CBCPad_arc 1, 2, 840, 113549, 3, 9
1513 #define rc5_CBCPad AsnOid(rc5_CBCPad_arc)
1514 #define desCDMF_arc 1, 2, 840, 113549, 3, 10
1515 #define desCDMF AsnOid(desCDMF_arc)
1516 #define dsa_bsafe_arc 1, 3, 14, 3, 2, 12
1517 #define dsa_bsafe AsnOid(dsa_bsafe_arc)
1518 #define id_data_arc 1, 2, 840, 113549, 1, 7, 1
1519 #define id_data AsnOid(id_data_arc)
1520 #define id_signedData_arc 1, 2, 840, 113549, 1, 7, 2
1521 #define id_signedData AsnOid(id_signedData_arc)
1522 #define id_envelopedData_arc 1, 2, 840, 113549, 1, 7, 3
1523 #define id_envelopedData AsnOid(id_envelopedData_arc)
1524 #define id_digestedData_arc 1, 2, 840, 113549, 1, 7, 5
1525 #define id_digestedData AsnOid(id_digestedData_arc)
1526 #define id_encryptedData_arc 1, 2, 840, 113549, 1, 7, 6
1527 #define id_encryptedData AsnOid(id_encryptedData_arc)
1528 #define id_ct_authData_arc 1, 2, 840, 113549, 1, 9, 16, 1, 2
1529 #define id_ct_authData AsnOid(id_ct_authData_arc)
1530 #define id_contentType_arc 1, 2, 840, 113549, 1, 9, 3
1531 #define id_contentType AsnOid(id_contentType_arc)
1532 #define id_messageDigest_arc 1, 2, 840, 113549, 1, 9, 4
1533 #define id_messageDigest AsnOid(id_messageDigest_arc)
1534 #define id_signingTime_arc 1, 2, 840, 113549, 1, 9, 5
1535 #define id_signingTime AsnOid(id_signingTime_arc)
1536 #define id_countersignature_arc 1, 2, 840, 113549, 1, 9, 6
1537 #define id_countersignature AsnOid(id_countersignature_arc)
1538 #define id_macValue_arc 1, 2, 840, 113549, 1, 9, 16, 2, 8
1539 #define id_macValue AsnOid(id_macValue_arc)
1540 #define id_dsa_arc 1, 2, 840, 10040, 4, 1
1541 #define id_dsa AsnOid(id_dsa_arc)
1542 //------------------------------------------------------------------------------
1544 #endif /* conditional include of sm_cms.h */