diff options
author | David Hook <dgh@bouncycastle.org> | 2019-01-15 08:05:41 +1100 |
---|---|---|
committer | David Hook <dgh@bouncycastle.org> | 2019-01-15 08:05:41 +1100 |
commit | 6ca2f2f9b941289f42d0ef0d2ef8f0cfa1e4ac86 (patch) | |
tree | 3c1d88a79669f1cf55de9a5731d63066f442de5c /crypto/src/cmp/GeneralPkiMessage.cs | |
parent | Merge remote-tracking branch 'origin/master' (diff) | |
download | BouncyCastle.NET-ed25519-6ca2f2f9b941289f42d0ef0d2ef8f0cfa1e4ac86.tar.xz |
refactor of PKMacBuilder
Diffstat (limited to 'crypto/src/cmp/GeneralPkiMessage.cs')
-rw-r--r-- | crypto/src/cmp/GeneralPkiMessage.cs | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/crypto/src/cmp/GeneralPkiMessage.cs b/crypto/src/cmp/GeneralPkiMessage.cs new file mode 100644 index 000000000..d91b8ef7e --- /dev/null +++ b/crypto/src/cmp/GeneralPkiMessage.cs @@ -0,0 +1,49 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Org.BouncyCastle.Asn1.Cmp +{ + public class GeneralPKIMessage + { + private readonly PkiMessage pkiMessage; + + private static PkiMessage parseBytes(byte[] encoding) + { + return PkiMessage.GetInstance(Asn1Object.FromByteArray(encoding)); + } + + public GeneralPKIMessage(PkiMessage pkiMessage) + { + this.pkiMessage = pkiMessage; + } + + public GeneralPKIMessage(byte[] encoding) : this(parseBytes(encoding)) + { + } + + public PkiHeader Header { + get { + return pkiMessage.Header; + } + } + + public PkiBody Body + { + get + { + return pkiMessage.Body; + } + } + + public bool HasProtection + { + get { return pkiMessage.Protection != null; } + } + + public PkiMessage ToAsn1Structure() + { + return pkiMessage; + } + } +} |