diff options
author | wbond <will@wbond.net> | 2015-06-03 14:52:18 -0400 |
---|---|---|
committer | wbond <will@wbond.net> | 2015-06-03 14:52:18 -0400 |
commit | e91513efcd9714573e6bcefd3bb4cd9e680f04f7 (patch) | |
tree | aa888da483100152ad24a1da5803599ed3cf30a9 /asn1crypto/pdf.py | |
download | asn1crypto-e91513efcd9714573e6bcefd3bb4cd9e680f04f7.tar.gz |
Initial version
Diffstat (limited to 'asn1crypto/pdf.py')
-rw-r--r-- | asn1crypto/pdf.py | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/asn1crypto/pdf.py b/asn1crypto/pdf.py new file mode 100644 index 0000000..f707682 --- /dev/null +++ b/asn1crypto/pdf.py @@ -0,0 +1,62 @@ +# coding: utf-8 +from __future__ import unicode_literals +from __future__ import absolute_import + +from .cms import CMSAttributeType, CMSAttribute +from .core import ( + Boolean, + Integer, + Null, + ObjectIdentifier, + OctetString, + Sequence, + SetOf, +) +from .crl import CertificateList +from .ocsp import OCSPResponse +from .x509 import ExtensionId, Extension, GeneralName, KeyPurposeId + + + +class AdobeArchiveRevInfo(Sequence): + _fields = [ + ('version', Integer) + ] + + +class AdobeTimestamp(Sequence): + _fields = [ + ('version', Integer), + ('location', GeneralName), + ('requires_auth', Boolean), + ] + + +class OtherRevInfo(Sequence): + _fields = [ + ('type', ObjectIdentifier), + ('value', OctetString), + ] + + +class RevocationInfoArchival(Sequence): + _fields = [ + ('crl', CertificateList, {'tag_type': 'explicit', 'tag': 0, 'optional': True}), + ('ocsp', OCSPResponse, {'tag_type': 'explicit', 'tag': 1, 'optional': True}), + ('other_rev_info', OtherRevInfo, {'tag_type': 'explicit', 'tag': 2, 'optional': True}), + ] + + +class SetOfRevocationInfoArchival(SetOf): + _child_spec = RevocationInfoArchival + + +ExtensionId._map['1.2.840.113583.1.1.9.2'] = 'adobe_archive_rev_info' #pylint: disable=W0212 +ExtensionId._map['1.2.840.113583.1.1.9.1'] = 'adobe_timestamp' #pylint: disable=W0212 +ExtensionId._map['1.2.840.113583.1.1.10'] = 'adobe_ppklite_credential' #pylint: disable=W0212 +Extension._oid_specs['adobe_archive_rev_info'] = AdobeArchiveRevInfo #pylint: disable=W0212 +Extension._oid_specs['adobe_timestamp'] = AdobeTimestamp #pylint: disable=W0212 +Extension._oid_specs['adobe_ppklite_credential'] = Null #pylint: disable=W0212 +KeyPurposeId._map['1.2.840.113583.1.1.5'] = 'pdf_signing' #pylint: disable=W0212 +CMSAttributeType._map['1.2.840.113583.1.1.8'] = 'adobe_revocation_info_archival' #pylint: disable=W0212 +CMSAttribute._oid_specs['adobe_revocation_info_archival'] = SetOfRevocationInfoArchival #pylint: disable=W0212 |