Package org.jetbrains.nativecerts.mac
Interface SecurityFramework
-
- All Superinterfaces:
com.sun.jna.Library
public interface SecurityFramework extends com.sun.jna.Library
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classSecurityFramework.OSStatusResult codes common to many Security framework functions.static classSecurityFramework.SecCertificateRefAn abstract Core Foundation-type object representing an X.509 certificate.static classSecurityFramework.SecPolicyRefAn object that represents a trust policy.static classSecurityFramework.SecTrustSettingsDomainThe trust settings domains.static classSecurityFramework.SecTrustSettingsResultTrust settings returned in usage constraints dictionaries.
-
Field Summary
Fields Modifier and Type Field Description static SecurityFrameworkINSTANCEstatic com.sun.jna.platform.mac.CoreFoundation.CFStringRefkSecPolicyAppleSSLBasic X509 plus host name verification per RFC 2818.static com.sun.jna.platform.mac.CoreFoundation.CFStringRefkSecPolicyOidThe object identifier that defines the policy type (CFStringRef).static com.sun.jna.platform.mac.CoreFoundation.CFStringRefkSecTrustSettingsAllowedErrorA number which, if encountered during certificate verification, is ignored for that certificate.static com.sun.jna.platform.mac.CoreFoundation.CFStringRefkSecTrustSettingsPolicyA policy object specifying the certificate verification policy.static com.sun.jna.platform.mac.CoreFoundation.CFStringRefkSecTrustSettingsPolicyNameSpecifies a cert verification policy, e.g., sslServer, eapClient, etc.static com.sun.jna.platform.mac.CoreFoundation.CFStringRefkSecTrustSettingsResultA number indicating the effective trust setting for this usage constraints dictionary.static com.sun.jna.platform.mac.CoreFoundation.CFTypeIDSEC_CERTIFICATE_TYPE_IDstatic com.sun.jna.platform.mac.CoreFoundation.CFTypeIDSEC_POLICY_TYPE_ID
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description @NotNull SecurityFramework.OSStatusSecCertificateCopyCommonName(@NotNull SecurityFramework.SecCertificateRef certificate, @NotNull CFStringRefByReference commonName)Retrieves the common name of the subject of a certificate.com.sun.jna.platform.mac.CoreFoundation.CFDataRefSecCertificateCopyData(SecurityFramework.SecCertificateRef certificate)Returns a DER representation of a certificate given a certificate object.com.sun.jna.platform.mac.CoreFoundation.CFTypeIDSecCertificateGetTypeID()com.sun.jna.platform.mac.CoreFoundation.CFStringRefSecCopyErrorMessageString(@NotNull SecurityFramework.OSStatus status, @Nullable com.sun.jna.Pointer reserved)Returns a string explaining the meaning of a security result code.com.sun.jna.platform.mac.CoreFoundation.CFDictionaryRefSecPolicyCopyProperties(SecurityFramework.SecPolicyRef policyRef)Returns a dictionary containing a policy’s properties.com.sun.jna.platform.mac.CoreFoundation.CFTypeIDSecPolicyGetTypeID()@NotNull SecurityFramework.OSStatusSecTrustSettingsCopyCertificates(@NotNull SecurityFramework.SecTrustSettingsDomain domain, @NotNull CFArrayRefByReference certArray)Obtains an array of all certificates that have trust settings in a specific trust settings domain.SecurityFramework.OSStatusSecTrustSettingsCopyTrustSettings(SecurityFramework.SecCertificateRef certRef, SecurityFramework.SecTrustSettingsDomain domain, CFArrayRefByReference trustSettings)Obtains the trust settings for a certificate.
-
-
-
Field Detail
-
INSTANCE
static final SecurityFramework INSTANCE
-
SEC_CERTIFICATE_TYPE_ID
static final com.sun.jna.platform.mac.CoreFoundation.CFTypeID SEC_CERTIFICATE_TYPE_ID
-
SEC_POLICY_TYPE_ID
static final com.sun.jna.platform.mac.CoreFoundation.CFTypeID SEC_POLICY_TYPE_ID
-
kSecPolicyAppleSSL
static final com.sun.jna.platform.mac.CoreFoundation.CFStringRef kSecPolicyAppleSSL
Basic X509 plus host name verification per RFC 2818.- See Also:
- developer.apple.com
-
kSecPolicyOid
static final com.sun.jna.platform.mac.CoreFoundation.CFStringRef kSecPolicyOid
The object identifier that defines the policy type (CFStringRef). All policies have a value for this key.- See Also:
- developer.apple.com
-
kSecTrustSettingsResult
static final com.sun.jna.platform.mac.CoreFoundation.CFStringRef kSecTrustSettingsResult
A number indicating the effective trust setting for this usage constraints dictionary.- See Also:
- developer.apple.com
-
kSecTrustSettingsAllowedError
static final com.sun.jna.platform.mac.CoreFoundation.CFStringRef kSecTrustSettingsAllowedError
A number which, if encountered during certificate verification, is ignored for that certificate.- See Also:
- developer.apple.com
-
kSecTrustSettingsPolicyName
static final com.sun.jna.platform.mac.CoreFoundation.CFStringRef kSecTrustSettingsPolicyName
Specifies a cert verification policy, e.g., sslServer, eapClient, etc. using policy names. This entry can be used to restrict the policy where the same Policy Constant is used for multiple policyNames
-
kSecTrustSettingsPolicy
static final com.sun.jna.platform.mac.CoreFoundation.CFStringRef kSecTrustSettingsPolicy
A policy object specifying the certificate verification policy.- See Also:
- developer.apple.com
-
-
Method Detail
-
SecCopyErrorMessageString
@Nullable com.sun.jna.platform.mac.CoreFoundation.CFStringRef SecCopyErrorMessageString(@NotNull @NotNull SecurityFramework.OSStatus status, @Nullable @Nullable com.sun.jna.Pointer reserved)Returns a string explaining the meaning of a security result code.- Parameters:
status- A result code of type OSStatus returned by a security function. See Security Framework Result Codes for a list of codes.reserved- Reserved for future use. Pass NULL for this parameter.- Returns:
- A human-readable string describing the result, or NULL if no string is available for the specified result code.
Call the
CoreFoundation.CFRelease(CoreFoundation.CFTypeRef)function to release this object when you are finished using it. - See Also:
- developer.apple.com
-
SecTrustSettingsCopyCertificates
@NotNull @NotNull SecurityFramework.OSStatus SecTrustSettingsCopyCertificates(@NotNull @NotNull SecurityFramework.SecTrustSettingsDomain domain, @NotNull @NotNull CFArrayRefByReference certArray)
Obtains an array of all certificates that have trust settings in a specific trust settings domain.- Parameters:
domain- The trust settings domain for which you want a list of certificates. For possible values, seeSecurityFramework.SecTrustSettingsDomain.certArray- On return, an array ofSecurityFramework.SecCertificateRefobjects representing the certificates that have trust settings in the specified domain. Call theCoreFoundation.CFRelease(CoreFoundation.CFTypeRef)function to release this object when you are finished with it.- Returns:
- A result code. See Security Framework Result Codes.
Returns
SecurityFramework.OSStatus.errSecNoTrustSettingsif no trust settings exist for the specified domain. - See Also:
- developer.apple.com
-
SecCertificateCopyCommonName
@NotNull @NotNull SecurityFramework.OSStatus SecCertificateCopyCommonName(@NotNull @NotNull SecurityFramework.SecCertificateRef certificate, @NotNull @NotNull CFStringRefByReference commonName)
Retrieves the common name of the subject of a certificate.- Parameters:
certificate- The certificate object from which to retrieve the common name.commonName- On return, points to the common name. Call theCoreFoundation.CFRelease(CoreFoundation.CFTypeRef)function to release this object when you are finished with it.- Returns:
- A result code. See
SecurityFramework.OSStatus - See Also:
- developer.apple.com
-
SecCertificateGetTypeID
com.sun.jna.platform.mac.CoreFoundation.CFTypeID SecCertificateGetTypeID()
-
SecPolicyGetTypeID
com.sun.jna.platform.mac.CoreFoundation.CFTypeID SecPolicyGetTypeID()
-
SecPolicyCopyProperties
com.sun.jna.platform.mac.CoreFoundation.CFDictionaryRef SecPolicyCopyProperties(SecurityFramework.SecPolicyRef policyRef)
Returns a dictionary containing a policy’s properties.- Parameters:
policyRef- The policy from which properties should be copied.- Returns:
- A dictionary with the policy's properties.
See Security Policy Keys
for a list of valid keys. Call the
CoreFoundation.CFRelease(CoreFoundation.CFTypeRef)function to free the dictionary's memory when you are done with it. - See Also:
- developer.apple.com
-
SecCertificateCopyData
com.sun.jna.platform.mac.CoreFoundation.CFDataRef SecCertificateCopyData(SecurityFramework.SecCertificateRef certificate)
Returns a DER representation of a certificate given a certificate object.- Parameters:
certificate- The certificate object for which you wish to return the DER (Distinguished Encoding Rules) representation of the X.509 certificate.- Returns:
- The DER representation of the certificate.
Call the
CoreFoundation.CFRelease(CoreFoundation.CFTypeRef)function to release this object when you are finished with it. Returns NULL if the data passed in the certificate parameter is not a valid certificate object. - See Also:
- developer.apple.com
-
SecTrustSettingsCopyTrustSettings
SecurityFramework.OSStatus SecTrustSettingsCopyTrustSettings(SecurityFramework.SecCertificateRef certRef, SecurityFramework.SecTrustSettingsDomain domain, CFArrayRefByReference trustSettings)
Obtains the trust settings for a certificate.- Parameters:
certRef- The certificate for which you want the trust settings. Pass the value kSecTrustSettingsDefaultRootCertSetting to obtain the default root certificate trust settings for the domain.domain- The trust settings domain of the trust settings that you wish to obtain. For possible values, seeSecurityFramework.SecTrustSettingsDomain.trustSettings- On return, an array ofCoreFoundation.CFDictionaryRefobjects specifying the trust settings for the certificate. For the contents of the dictionaries, see the discussion below. Call theCoreFoundation.CFRelease(CoreFoundation.CFTypeRef)function to release this object when you are finished with it.- Returns:
- A result code. See
SecurityFramework.OSStatus. ReturnsSecurityFramework.OSStatus.errSecItemNotFoundif no trust settings exist for the specified certificate and domain. - See Also:
- developer.apple.com
-
-