Partager via


X509Credentials Class

public class X509Credentials extends SecurityCredentials

Specifies the security credentials that are based upon X.509 certificates which are located in Windows certificate store.

Constructor Summary

Constructor Description
X509Credentials()

Creates a new instance of the system.fabric.X509Credentials class.

Method Summary

Modifier and Type Method and Description
X509FindType getFindType()

Gets the value which indicates how to find local certificate in Windows certificate store

Object getFindValue()

Specifies the filter value used to search local certificate in certificate store. FindType specifies the type of filter value.

Object getFindValueSecondary()

Gets the secondary find value for loading local certificate credential.

List<String> getIssuerThumbprints()

When not empty, this dictates the certificate thumbprints of direct issuer of remote certificates.

ProtectionLevel getProtectionLevel()

Gets how communication is protected, default value is ENCRYPTANDSIGN.

List<String> getRemoteCertThumbprints()

Gets the list of remote certificate thumbprints, used to validate remote X509Credentials

List<String> getRemoteCommonNames()

Indicates the expected common names of remote certificates that you want Service Fabric to validate against.

List<X509Name> getRemoteX509Names()

Gets the list of X509Name to validate remote X509Credentials

X509StoreLocation getStoreLocation()

Gets the location of the certificate store.

String getStoreName()

Gets the name of the store where the certificate is stored.

void setFindType(X509FindType findType)

Specifies how to find local certificate in Windows certificate store. Supported values: FINDBYTHUMBPRINT - find certificate by certificate thumbprint FINDBYSUBJECTNAME - find certificate by subject distinguished name or common name, when subject distinguished name is provided in FindValue, subject name in the certificate must be encoded in ASN encoding due to a restriction in native Windows crypto API. There is no such restriction when common name is provided in FindValue.

void setFindValue(Object findValue)

Specifies the filter value used to search local certificate in certificate store. FindType specifies the type of filter value.

void setFindValueSecondary(Object findValueSecondary)

Sets the secondary find value for loading local certificate credential.

void setProtectionLevel(ProtectionLevel protectionLevel)

Sets how communication is protected, default value is ENCRYPTANDSIGN.

void setStoreLocation(X509StoreLocation storeLocation)

Sets the location of the certificate store.

void setStoreName(String storeName)

Sets the name of the store where the certificate is stored.

Inherited Members

Constructor Details

X509Credentials

public X509Credentials()

Creates a new instance of the system.fabric.X509Credentials class.

Method Details

getFindType

public X509FindType getFindType()

Gets the value which indicates how to find local certificate in Windows certificate store

Returns:

The find type used to look for certificate.

getFindValue

public Object getFindValue()

Specifies the filter value used to search local certificate in certificate store. FindType specifies the type of filter value.

Returns:

The value of security credentials to use to secure the cluster.

getFindValueSecondary

public Object getFindValueSecondary()

Gets the secondary find value for loading local certificate credential.

Returns:

The secondary find value for loading local certificate credential.

getIssuerThumbprints

public List getIssuerThumbprints()

When not empty, this dictates the certificate thumbprints of direct issuer of remote certificates.

Returns:

The certificate thumbprints of direct issuer of remote certificates.

getProtectionLevel

public ProtectionLevel getProtectionLevel()

Gets how communication is protected, default value is ENCRYPTANDSIGN.

Returns:

The protection level of the credential.

getRemoteCertThumbprints

public List getRemoteCertThumbprints()

Gets the list of remote certificate thumbprints, used to validate remote X509Credentials

Returns:

List of remote certificate thumbprints, used to validate remote X509Credentials

getRemoteCommonNames

public List getRemoteCommonNames()

Indicates the expected common names of remote certificates that you want Service Fabric to validate against.

Returns:

The expected common names of remote certificates that you want Service Fabric to validate against.

getRemoteX509Names

public List getRemoteX509Names()

Gets the list of X509Name to validate remote X509Credentials

Returns:

the list of X509Name to validate remote X509Credentials

getStoreLocation

public X509StoreLocation getStoreLocation()

Gets the location of the certificate store.

Returns:

The location of the certificate store.

getStoreName

public String getStoreName()

Gets the name of the store where the certificate is stored.

Returns:

The name of the store where the certificate is stored.

setFindType

public void setFindType(X509FindType findType)

Specifies how to find local certificate in Windows certificate store. Supported values: FINDBYTHUMBPRINT - find certificate by certificate thumbprint FINDBYSUBJECTNAME - find certificate by subject distinguished name or common name, when subject distinguished name is provided in FindValue, subject name in the certificate must be encoded in ASN encoding due to a restriction in native Windows crypto API. There is no such restriction when common name is provided in FindValue.

Parameters:

findType - The find type used to look for certificate.

setFindValue

public void setFindValue(Object findValue)

Specifies the filter value used to search local certificate in certificate store. FindType specifies the type of filter value.

Parameters:

findValue - The value of security credentials to use to secure the cluster.

setFindValueSecondary

public void setFindValueSecondary(Object findValueSecondary)

Sets the secondary find value for loading local certificate credential.

Parameters:

findValueSecondary - Secondary find value for loading local certificate credential.

setProtectionLevel

public void setProtectionLevel(ProtectionLevel protectionLevel)

Sets how communication is protected, default value is ENCRYPTANDSIGN.

Parameters:

protectionLevel - The protection level of the credential.

setStoreLocation

public void setStoreLocation(X509StoreLocation storeLocation)

Sets the location of the certificate store.

Parameters:

storeLocation - The location of the certificate store.

setStoreName

public void setStoreName(String storeName)

Sets the name of the store where the certificate is stored.

Parameters:

storeName - The name of the store where the certificate is stored.

Applies to