Ejemplo n.º 1
0
        public PacSignature(PacType ptype, EncryptionType etype)
        {
            this.PacType = ptype;
            this.Type    = CryptoService.ConvertType(etype);

            this.Signature = SetSignatureValue(this.Type, size => new byte[size]);
        }
Ejemplo n.º 2
0
        public static KrbChecksum Create(ReadOnlyMemory <byte> data, KerberosKey key, KeyUsage ku, ChecksumType type = 0)
        {
            if (key == null)
            {
                throw new ArgumentNullException(nameof(key));
            }

            if (type == 0)
            {
                type = CryptoService.ConvertType(key.EncryptionType);
            }

            var checksum = CryptoService.CreateChecksum(type, signatureData: data);

            if (checksum == null)
            {
                throw new InvalidOperationException($"CryptoService couldn't create a transform for type {type}");
            }

            checksum.Usage = ku;

            checksum.Sign(key);

            return(new KrbChecksum
            {
                Checksum = checksum.Signature,
                Type = type
            });
        }
Ejemplo n.º 3
0
        public static KrbChecksum Create(ReadOnlyMemory <byte> data, KerberosKey key, KeyUsage ku, ChecksumType type = 0)
        {
            if (type == 0)
            {
                type = CryptoService.ConvertType(key.EncryptionType);
            }

            var checksum = CryptoService.CreateChecksum(type, signatureData: data);

            checksum.Usage = ku;

            checksum.Sign(key);

            return(new KrbChecksum
            {
                Checksum = checksum.Signature,
                Type = type
            });
        }