Beispiel #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);
        }
Beispiel #2
0
 public ServiceAuthentication(ServiceAuthenticationType type)
     : this(type, null, null)
 {
 }