diff options
author | Oren Novotny <oren@novotny.org> | 2014-02-26 10:08:50 -0500 |
---|---|---|
committer | Oren Novotny <oren@novotny.org> | 2014-02-26 10:08:50 -0500 |
commit | 176743ab5faec2dd275b5efd3a2dd62c610f237a (patch) | |
tree | 1d2e50c534a479d749c266d7c52434d8f17f86aa /Crypto/src/asn1/pkcs/EncryptionScheme.cs | |
parent | Add git files (diff) | |
download | BouncyCastle.NET-ed25519-1.7.0.tar.xz |
Add BouncyCastle PCL files v1.7.0
Diffstat (limited to 'Crypto/src/asn1/pkcs/EncryptionScheme.cs')
-rw-r--r-- | Crypto/src/asn1/pkcs/EncryptionScheme.cs | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/Crypto/src/asn1/pkcs/EncryptionScheme.cs b/Crypto/src/asn1/pkcs/EncryptionScheme.cs new file mode 100644 index 000000000..5b64d6f67 --- /dev/null +++ b/Crypto/src/asn1/pkcs/EncryptionScheme.cs @@ -0,0 +1,49 @@ +using System; + +using Org.BouncyCastle.Asn1; +using Org.BouncyCastle.Asn1.X509; + +namespace Org.BouncyCastle.Asn1.Pkcs +{ + public class EncryptionScheme + : AlgorithmIdentifier + { + public EncryptionScheme( + DerObjectIdentifier objectID, + Asn1Encodable parameters) + : base(objectID, parameters) + { + } + + internal EncryptionScheme( + Asn1Sequence seq) + : this((DerObjectIdentifier)seq[0], seq[1]) + { + } + + public new static EncryptionScheme GetInstance(object obj) + { + if (obj is EncryptionScheme) + { + return (EncryptionScheme)obj; + } + + if (obj is Asn1Sequence) + { + return new EncryptionScheme((Asn1Sequence)obj); + } + + throw new ArgumentException("Unknown object in factory: " + obj.GetType().FullName, "obj"); + } + + public Asn1Object Asn1Object + { + get { return Parameters.ToAsn1Object(); } + } + + public override Asn1Object ToAsn1Object() + { + return new DerSequence(ObjectID, Parameters); + } + } +} |