summary refs log tree commit diff
path: root/crypto/src/bcpg/sig/Revocable.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/bcpg/sig/Revocable.cs')
-rw-r--r--crypto/src/bcpg/sig/Revocable.cs23
1 files changed, 4 insertions, 19 deletions
diff --git a/crypto/src/bcpg/sig/Revocable.cs b/crypto/src/bcpg/sig/Revocable.cs
index 6ded4d865..88dbf5195 100644
--- a/crypto/src/bcpg/sig/Revocable.cs
+++ b/crypto/src/bcpg/sig/Revocable.cs
@@ -1,5 +1,3 @@
-using System;
-
 namespace Org.BouncyCastle.Bcpg.Sig
 {
     /**
@@ -8,29 +6,16 @@ namespace Org.BouncyCastle.Bcpg.Sig
     public class Revocable
         : SignatureSubpacket
     {
-        private static byte[] BooleanToByteArray(bool value)
-        {
-            return new byte[1]{ Convert.ToByte(value) };
-        }
-
-        public Revocable(
-            bool    critical,
-            bool    isLongLength,
-            byte[]  data)
+        public Revocable(bool critical, bool isLongLength, byte[] data)
             : base(SignatureSubpacketTag.Revocable, critical, isLongLength, data)
         {
         }
 
-        public Revocable(
-            bool    critical,
-            bool    isRevocable)
-            : base(SignatureSubpacketTag.Revocable, critical, false, BooleanToByteArray(isRevocable))
+        public Revocable(bool critical, bool isRevocable)
+            : base(SignatureSubpacketTag.Revocable, critical, false, Utilities.BooleanToBytes(isRevocable))
         {
         }
 
-        public bool IsRevocable()
-        {
-            return data[0] != 0;
-        }
+        public bool IsRevocable() => Utilities.BooleanFromBytes(data);
     }
 }