# coding: utf-8
# PyGOST -- Pure Python GOST cryptographic functions library
-# Copyright (C) 2015-2019 Sergey Matveev <stargrave@stargrave.org>
+# Copyright (C) 2015-2023 Sergey Matveev <stargrave@stargrave.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# the Free Software Foundation, version 3 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
from pygost.asn1schemas.cms import CMSVersion
from pygost.asn1schemas.cms import ContentType
from pygost.asn1schemas.cms import Gost2814789Parameters
+from pygost.asn1schemas.cms import Gost341215EncryptionParameters
from pygost.asn1schemas.oids import id_data
from pygost.asn1schemas.oids import id_encryptedData
from pygost.asn1schemas.oids import id_Gost28147_89
+from pygost.asn1schemas.oids import id_gostr3412_2015_kuznyechik_ctracpkm
+from pygost.asn1schemas.oids import id_gostr3412_2015_kuznyechik_ctracpkm_omac
+from pygost.asn1schemas.oids import id_gostr3412_2015_magma_ctracpkm
+from pygost.asn1schemas.oids import id_gostr3412_2015_magma_ctracpkm_omac
from pygost.asn1schemas.oids import id_pbes2
from pygost.asn1schemas.oids import id_pbkdf2
+from pygost.asn1schemas.oids import id_pkcs9_certTypes_x509Certificate
+from pygost.asn1schemas.prvkey import PrivateKeyInfo
from pygost.asn1schemas.x509 import AlgorithmIdentifier
+from pygost.asn1schemas.x509 import Certificate
class PBKDF2Salt(Choice):
class PBES2Encs(AlgorithmIdentifier):
schema = (
("algorithm", ObjectIdentifier(defines=(
- (("parameters",), {id_Gost28147_89: Gost2814789Parameters()}),
+ (("parameters",), {
+ id_Gost28147_89: Gost2814789Parameters(),
+ id_gostr3412_2015_magma_ctracpkm: Gost341215EncryptionParameters(),
+ id_gostr3412_2015_magma_ctracpkm_omac: Gost341215EncryptionParameters(),
+ id_gostr3412_2015_kuznyechik_ctracpkm: Gost341215EncryptionParameters(),
+ id_gostr3412_2015_kuznyechik_ctracpkm_omac: Gost341215EncryptionParameters(),
+ }),
))),
("parameters", Any(optional=True)),
)
class PKCS8ShroudedKeyBag(EncryptedPrivateKeyInfo):
pass
+
+
+OctetStringX509Certificate = Certificate(expl=OctetString.tag_default)
+
+
+class CertTypes(Any):
+ pass
+
+
+class CertBag(Sequence):
+ schema = (
+ ("certId", ObjectIdentifier(defines=(
+ (("certValue",), {
+ id_pkcs9_certTypes_x509Certificate: OctetStringX509Certificate(),
+ }),
+ ))),
+ ("certValue", CertTypes(expl=tag_ctxc(0))),
+ )
+
+
+class KeyBag(PrivateKeyInfo):
+ pass