You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
875 B
33 lines
875 B
using System;
|
|
using System.Collections;
|
|
|
|
using Org.BouncyCastle.Bcpg.Attr;
|
|
using Org.BouncyCastle.Utilities;
|
|
|
|
namespace Org.BouncyCastle.Bcpg.OpenPgp
|
|
{
|
|
public class PgpUserAttributeSubpacketVectorGenerator
|
|
{
|
|
private IList list = Platform.CreateArrayList();
|
|
|
|
public virtual void SetImageAttribute(
|
|
ImageAttrib.Format imageType,
|
|
byte[] imageData)
|
|
{
|
|
if (imageData == null)
|
|
throw new ArgumentException("attempt to set null image", "imageData");
|
|
|
|
list.Add(new ImageAttrib(imageType, imageData));
|
|
}
|
|
|
|
public virtual PgpUserAttributeSubpacketVector Generate()
|
|
{
|
|
UserAttributeSubpacket[] a = new UserAttributeSubpacket[list.Count];
|
|
for (int i = 0; i < list.Count; ++i)
|
|
{
|
|
a[i] = (UserAttributeSubpacket)list[i];
|
|
}
|
|
return new PgpUserAttributeSubpacketVector(a);
|
|
}
|
|
}
|
|
}
|
|
|