示例#1
0
        public static OmniCertificate Create(OmniDigitalSignature digitalSignature, ReadOnlySequence <byte> sequence)
        {
            if (digitalSignature is null)
            {
                throw new ArgumentNullException(nameof(digitalSignature));
            }

            ReadOnlyMemory <byte> value;

            if (digitalSignature.AlgorithmType == OmniDigitalSignatureAlgorithmType.EcDsa_P521_Sha2_256)
            {
                value = EcDsa_P521_Sha2_256.Sign(digitalSignature.PrivateKey, sequence);
            }
            else
            {
                throw new NotSupportedException(nameof(digitalSignature.AlgorithmType));
            }

            return(new OmniCertificate(digitalSignature.Name, digitalSignature.AlgorithmType, digitalSignature.PublicKey, value));
        }
示例#2
0
 public static OmniCertificate CreateOmniCertificate(OmniDigitalSignature digitalSignature, ReadOnlySequence <byte> sequence)
 {
     return(OmniCertificate.Create(digitalSignature, sequence));
 }