summary refs log tree commit diff
path: root/crypto/src/bcpg/sig/SignerUserId.cs
blob: bfa00d078066f001341924a98bc3c5d018def46d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
using Org.BouncyCastle.Utilities;

namespace Org.BouncyCastle.Bcpg.Sig
{
    /**
    * packet giving the User ID of the signer.
    */
    public class SignerUserId
        : SignatureSubpacket
    {
        public SignerUserId(bool critical, bool isLongLength, byte[] data)
            : base(SignatureSubpacketTag.SignerUserId, critical, isLongLength, data)
		{
		}

        public SignerUserId(bool critical, string userId)
            : base(SignatureSubpacketTag.SignerUserId, critical, false, Strings.ToUtf8ByteArray(userId))
		{
        }

        public string GetId() => Strings.FromUtf8ByteArray(data);

        public byte[] GetRawId() => Arrays.Clone(data);
    }
}