summary refs log tree commit diff
path: root/crypto/src/openpgp/PgpUserAttributeSubpacketVector.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/openpgp/PgpUserAttributeSubpacketVector.cs')
-rw-r--r--crypto/src/openpgp/PgpUserAttributeSubpacketVector.cs9
1 files changed, 9 insertions, 0 deletions
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(