summary refs log tree commit diff
path: root/crypto/src/bcpg/sig/IssuerFingerprint.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/bcpg/sig/IssuerFingerprint.cs')
-rw-r--r--crypto/src/bcpg/sig/IssuerFingerprint.cs28
1 files changed, 28 insertions, 0 deletions
diff --git a/crypto/src/bcpg/sig/IssuerFingerprint.cs b/crypto/src/bcpg/sig/IssuerFingerprint.cs
new file mode 100644
index 000000000..469a8e0d8
--- /dev/null
+++ b/crypto/src/bcpg/sig/IssuerFingerprint.cs
@@ -0,0 +1,28 @@
+using System;
+
+using Org.BouncyCastle.Utilities;
+
+namespace Org.BouncyCastle.Bcpg.Sig
+{
+    /**
+     * packet giving the issuer key fingerprint.
+     */
+    public class IssuerFingerprint
+        : SignatureSubpacket
+    {
+        public IssuerFingerprint(bool critical, bool isLongLength, byte[] data)
+            : base(SignatureSubpacketTag.IssuerFingerprint, critical, isLongLength, data)
+        {
+        }
+
+        public IssuerFingerprint(bool critical, int keyVersion, byte[] fingerprint)
+            : base(SignatureSubpacketTag.IssuerFingerprint, critical, false,
+                Arrays.Prepend(fingerprint, (byte)keyVersion))
+        {
+        }
+
+        public int KeyVersion => data[0];
+
+        public byte[] GetFingerprint() => Arrays.CopyOfRange(data, 1, data.Length);
+    }
+}