Exemple #1
0
        ServiceAuthentication(ServiceAuthenticationType type, SymmetricKeyAuthentication symmetricKey, X509ThumbprintAuthentication x509Thumbprint)
        {
            Preconditions.CheckArgument(type != ServiceAuthenticationType.SymmetricKey || symmetricKey != null, $"{nameof(SymmetricKeyAuthentication)} should not be null when type is {ServiceAuthenticationType.SymmetricKey}");
            Preconditions.CheckArgument(type != ServiceAuthenticationType.CertificateThumbprint || x509Thumbprint != null, $"{nameof(X509ThumbprintAuthentication)} should not be null when type is {ServiceAuthenticationType.CertificateThumbprint}");

            this.Type           = type;
            this.SymmetricKey   = Option.Maybe(symmetricKey);
            this.X509Thumbprint = Option.Maybe(x509Thumbprint);
        }
Exemple #2
0
 public ServiceAuthentication(X509ThumbprintAuthentication x509ThumbprintAuthentication)
     : this(ServiceAuthenticationType.CertificateThumbprint, null, Preconditions.CheckNotNull(x509ThumbprintAuthentication, nameof(x509ThumbprintAuthentication)))
 {
 }