summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--crypto/src/openpgp/PgpSignatureSubpacketVector.cs9
-rw-r--r--crypto/src/openpgp/PgpUserAttributeSubpacketVector.cs9
2 files changed, 18 insertions, 0 deletions
diff --git a/crypto/src/openpgp/PgpSignatureSubpacketVector.cs b/crypto/src/openpgp/PgpSignatureSubpacketVector.cs
index 3dc96ea90..810f49c3e 100644
--- a/crypto/src/openpgp/PgpSignatureSubpacketVector.cs
+++ b/crypto/src/openpgp/PgpSignatureSubpacketVector.cs
@@ -9,6 +9,15 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp
 	/// <remarks>Container for a list of signature subpackets.</remarks>
     public class PgpSignatureSubpacketVector
     {
+        public static PgpSignatureSubpacketVector FromSubpackets(SignatureSubpacket[] packets)
+        {
+            if (packets == null)
+            {
+                packets = new SignatureSubpacket[0];
+            }
+            return new PgpSignatureSubpacketVector(packets);
+        }
+
         private readonly SignatureSubpacket[] packets;
 
 		internal PgpSignatureSubpacketVector(
diff --git a/crypto/src/openpgp/PgpUserAttributeSubpacketVector.cs b/crypto/src/openpgp/PgpUserAttributeSubpacketVector.cs
index 4cdbeda54..df5081390 100644
--- a/crypto/src/openpgp/PgpUserAttributeSubpacketVector.cs
+++ b/crypto/src/openpgp/PgpUserAttributeSubpacketVector.cs
@@ -5,6 +5,15 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp
 	/// <remarks>Container for a list of user attribute subpackets.</remarks>
     public class PgpUserAttributeSubpacketVector
     {
+        public static PgpUserAttributeSubpacketVector FromSubpackets(UserAttributeSubpacket[] packets)
+        {
+            if (packets == null)
+            {
+                packets = new UserAttributeSubpacket[0];
+            }
+            return new PgpUserAttributeSubpacketVector(packets);
+        }
+
         private readonly UserAttributeSubpacket[] packets;
 
 		internal PgpUserAttributeSubpacketVector(