IssuedTokenServiceCredential.TrustedStoreLocation Proprietà
Definizione
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Ottiene o imposta il percorso dell'archivio attendibile.
public:
property System::Security::Cryptography::X509Certificates::StoreLocation TrustedStoreLocation { System::Security::Cryptography::X509Certificates::StoreLocation get(); void set(System::Security::Cryptography::X509Certificates::StoreLocation value); };
public System.Security.Cryptography.X509Certificates.StoreLocation TrustedStoreLocation { get; set; }
member this.TrustedStoreLocation : System.Security.Cryptography.X509Certificates.StoreLocation with get, set
Public Property TrustedStoreLocation As StoreLocation
Valore della proprietà
Percorso dell'archivio attendibile.
Esempio
Nel codice seguente viene illustrato un modo per accedere a questa proprietà e impostarla.
// This method configures the IssuedTokenAuthentication property of a ServiceHost.
public static void ConfigureIssuedTokenServiceCredentials(
ServiceHost sh, bool allowCardspaceTokens, IList<X509Certificate2> knownissuers,
X509CertificateValidationMode certMode, X509RevocationMode revocationMode, SamlSerializer ser )
{
// Allow CardSpace tokens.
sh.Credentials.IssuedTokenAuthentication.AllowUntrustedRsaIssuers = allowCardspaceTokens;
// Set up known issuer certificates.
foreach(X509Certificate2 cert in knownissuers)
sh.Credentials.IssuedTokenAuthentication.KnownCertificates.Add ( cert );
// Set issuer certificate validation and revocation checking modes.
sh.Credentials.IssuedTokenAuthentication.CertificateValidationMode =
X509CertificateValidationMode.PeerOrChainTrust;
sh.Credentials.IssuedTokenAuthentication.RevocationMode = X509RevocationMode.Online;
sh.Credentials.IssuedTokenAuthentication.TrustedStoreLocation = StoreLocation.LocalMachine;
// Set the SamlSerializer, if one is specified.
if ( ser != null )
sh.Credentials.IssuedTokenAuthentication.SamlSerializer = ser;
}
' This method configures the IssuedTokenAuthentication property of a ServiceHost.
Public Shared Sub ConfigureIssuedTokenServiceCredentials( _
ByVal sh As ServiceHost, _
ByVal allowCardspaceTokens As Boolean, _
ByVal knownissuers As IList(Of X509Certificate2), _
ByVal certMode As X509CertificateValidationMode, _
ByVal revocationMode As X509RevocationMode, _
ByVal ser As SamlSerializer _
)
' Allow CardSpace tokens.
sh.Credentials.IssuedTokenAuthentication.AllowUntrustedRsaIssuers = _
allowCardspaceTokens
' Set up known issuer certificates.
Dim cert As X509Certificate2
For Each cert In knownissuers
sh.Credentials.IssuedTokenAuthentication.KnownCertificates.Add(cert)
Next cert
' Set issuer certificate validation and revocation checking modes.
sh.Credentials.IssuedTokenAuthentication.CertificateValidationMode = _
X509CertificateValidationMode.PeerOrChainTrust
sh.Credentials.IssuedTokenAuthentication.RevocationMode = _
X509RevocationMode.Online
' Set the SamlSerializer, if one is specified.
If Not (ser Is Nothing) Then
sh.Credentials.IssuedTokenAuthentication.SamlSerializer = ser
End If
End Sub
Si applica a
Collabora con noi su GitHub
L'origine di questo contenuto è disponibile in GitHub, in cui è anche possibile creare ed esaminare i problemi e le richieste pull. Per ulteriori informazioni, vedere la guida per i collaboratori.