public PacSignature(PacType ptype, EncryptionType etype) { this.PacType = ptype; this.Type = CryptoService.ConvertType(etype); this.Signature = SetSignatureValue(this.Type, size => new byte[size]); }
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 }); }
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 }); }