summary refs log tree commit diff
path: root/crypto/src/bcpg/sig/PrimaryUserId.cs
blob: f1637a2b93d6ea904ceee841722887809182cad2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
namespace Org.BouncyCastle.Bcpg.Sig
{
    /**
    * packet giving whether or not the signature is signed using the primary user ID for the key.
    */
    public class PrimaryUserId
        : SignatureSubpacket
    {
        public PrimaryUserId(bool critical, bool isLongLength, byte[] data)
            : base(SignatureSubpacketTag.PrimaryUserId, critical, isLongLength, data)
        {
        }

        public PrimaryUserId(bool critical, bool isPrimaryUserId)
            : base(SignatureSubpacketTag.PrimaryUserId, critical, false, Utilities.BooleanToBytes(isPrimaryUserId))
        {
        }

        public bool IsPrimaryUserId() => Utilities.BooleanFromBytes(data);
    }
}