public final class Security
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static CFStringRef |
kSecAttrAccessControl() |
static CFStringRef |
kSecAttrAccessGroup() |
static CFStringRef |
kSecAttrAccessGroupToken()
[@enum] kSecAttrAccessGroup Value Constants
[@constant] kSecAttrAccessGroupToken Represents well-known access group
which contains items provided by external token (typically smart card).
|
static CFStringRef |
kSecAttrAccessible()
[@enum] Attribute Key Constants
|
static CFStringRef |
kSecAttrAccessibleAfterFirstUnlock() |
static CFStringRef |
kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly() |
static CFStringRef |
kSecAttrAccessibleAlways() |
static CFStringRef |
kSecAttrAccessibleAlwaysThisDeviceOnly() |
static CFStringRef |
kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly() |
static CFStringRef |
kSecAttrAccessibleWhenUnlocked()
[@enum] kSecAttrAccessible Value Constants
|
static CFStringRef |
kSecAttrAccessibleWhenUnlockedThisDeviceOnly() |
static CFStringRef |
kSecAttrAccount() |
static CFStringRef |
kSecAttrApplicationLabel() |
static CFStringRef |
kSecAttrApplicationTag() |
static CFStringRef |
kSecAttrAuthenticationType() |
static CFStringRef |
kSecAttrAuthenticationTypeDefault() |
static CFStringRef |
kSecAttrAuthenticationTypeDPA() |
static CFStringRef |
kSecAttrAuthenticationTypeHTMLForm() |
static CFStringRef |
kSecAttrAuthenticationTypeHTTPBasic() |
static CFStringRef |
kSecAttrAuthenticationTypeHTTPDigest() |
static CFStringRef |
kSecAttrAuthenticationTypeMSN() |
static CFStringRef |
kSecAttrAuthenticationTypeNTLM()
[@enum] kSecAttrAuthenticationType Value Constants
|
static CFStringRef |
kSecAttrAuthenticationTypeRPA() |
static CFStringRef |
kSecAttrCanDecrypt() |
static CFStringRef |
kSecAttrCanDerive() |
static CFStringRef |
kSecAttrCanEncrypt() |
static CFStringRef |
kSecAttrCanSign() |
static CFStringRef |
kSecAttrCanUnwrap() |
static CFStringRef |
kSecAttrCanVerify() |
static CFStringRef |
kSecAttrCanWrap() |
static CFStringRef |
kSecAttrCertificateEncoding() |
static CFStringRef |
kSecAttrCertificateType() |
static CFStringRef |
kSecAttrComment() |
static CFStringRef |
kSecAttrCreationDate() |
static CFStringRef |
kSecAttrCreator() |
static CFStringRef |
kSecAttrDescription() |
static CFStringRef |
kSecAttrEffectiveKeySize() |
static CFStringRef |
kSecAttrGeneric() |
static CFStringRef |
kSecAttrIsExtractable() |
static CFStringRef |
kSecAttrIsInvisible() |
static CFStringRef |
kSecAttrIsNegative() |
static CFStringRef |
kSecAttrIsPermanent() |
static CFStringRef |
kSecAttrIsSensitive() |
static CFStringRef |
kSecAttrIssuer() |
static CFStringRef |
kSecAttrKeyClass() |
static CFStringRef |
kSecAttrKeyClassPrivate() |
static CFStringRef |
kSecAttrKeyClassPublic()
[@enum] kSecAttrKeyClass Value Constants
|
static CFStringRef |
kSecAttrKeyClassSymmetric() |
static CFStringRef |
kSecAttrKeySizeInBits() |
static CFStringRef |
kSecAttrKeyType() |
static CFStringRef |
kSecAttrKeyTypeEC() |
static CFStringRef |
kSecAttrKeyTypeECSECPrimeRandom() |
static CFStringRef |
kSecAttrKeyTypeRSA()
[@enum] kSecAttrKeyType Value Constants
|
static CFStringRef |
kSecAttrLabel() |
static CFStringRef |
kSecAttrModificationDate() |
static CFStringRef |
kSecAttrPath() |
static CFStringRef |
kSecAttrPersistantReference() |
static CFStringRef |
kSecAttrPersistentReference() |
static CFStringRef |
kSecAttrPort() |
static CFStringRef |
kSecAttrProtocol() |
static CFStringRef |
kSecAttrProtocolAFP() |
static CFStringRef |
kSecAttrProtocolAppleTalk() |
static CFStringRef |
kSecAttrProtocolDAAP() |
static CFStringRef |
kSecAttrProtocolEPPC() |
static CFStringRef |
kSecAttrProtocolFTP()
[@enum] kSecAttrProtocol Value Constants
|
static CFStringRef |
kSecAttrProtocolFTPAccount() |
static CFStringRef |
kSecAttrProtocolFTPProxy() |
static CFStringRef |
kSecAttrProtocolFTPS() |
static CFStringRef |
kSecAttrProtocolHTTP() |
static CFStringRef |
kSecAttrProtocolHTTPProxy() |
static CFStringRef |
kSecAttrProtocolHTTPS() |
static CFStringRef |
kSecAttrProtocolHTTPSProxy() |
static CFStringRef |
kSecAttrProtocolIMAP() |
static CFStringRef |
kSecAttrProtocolIMAPS() |
static CFStringRef |
kSecAttrProtocolIPP() |
static CFStringRef |
kSecAttrProtocolIRC() |
static CFStringRef |
kSecAttrProtocolIRCS() |
static CFStringRef |
kSecAttrProtocolLDAP() |
static CFStringRef |
kSecAttrProtocolLDAPS() |
static CFStringRef |
kSecAttrProtocolNNTP() |
static CFStringRef |
kSecAttrProtocolNNTPS() |
static CFStringRef |
kSecAttrProtocolPOP3() |
static CFStringRef |
kSecAttrProtocolPOP3S() |
static CFStringRef |
kSecAttrProtocolRTSP() |
static CFStringRef |
kSecAttrProtocolRTSPProxy() |
static CFStringRef |
kSecAttrProtocolSMB() |
static CFStringRef |
kSecAttrProtocolSMTP() |
static CFStringRef |
kSecAttrProtocolSOCKS() |
static CFStringRef |
kSecAttrProtocolSSH() |
static CFStringRef |
kSecAttrProtocolTelnet() |
static CFStringRef |
kSecAttrProtocolTelnetS() |
static CFStringRef |
kSecAttrPublicKeyHash() |
static CFStringRef |
kSecAttrSecurityDomain() |
static CFStringRef |
kSecAttrSerialNumber() |
static CFStringRef |
kSecAttrServer() |
static CFStringRef |
kSecAttrService() |
static CFStringRef |
kSecAttrSubject() |
static CFStringRef |
kSecAttrSubjectKeyID() |
static CFStringRef |
kSecAttrSynchronizable() |
static CFStringRef |
kSecAttrSynchronizableAny() |
static CFStringRef |
kSecAttrSyncViewHint() |
static CFStringRef |
kSecAttrTokenID() |
static CFStringRef |
kSecAttrTokenIDSecureEnclave()
[@enum] kSecAttrTokenID Value Constants
|
static CFStringRef |
kSecAttrType() |
static CFStringRef |
kSecClass()
[@enum] Class Key Constant
|
static CFStringRef |
kSecClassCertificate() |
static CFStringRef |
kSecClassGenericPassword() |
static CFStringRef |
kSecClassIdentity() |
static CFStringRef |
kSecClassInternetPassword()
[@enum] Class Value Constants
|
static CFStringRef |
kSecClassKey() |
static CFStringRef |
kSecImportExportPassphrase()
[@enum] Import/Export options
|
static CFStringRef |
kSecImportItemCertChain() |
static CFStringRef |
kSecImportItemIdentity() |
static CFStringRef |
kSecImportItemKeyID() |
static CFStringRef |
kSecImportItemLabel()
[@enum] Import/Export item description
|
static CFStringRef |
kSecImportItemTrust() |
static CFStringRef |
kSecKeyAlgorithmECDHKeyExchangeCofactor() |
static CFStringRef |
kSecKeyAlgorithmECDHKeyExchangeCofactorX963SHA1() |
static CFStringRef |
kSecKeyAlgorithmECDHKeyExchangeCofactorX963SHA224() |
static CFStringRef |
kSecKeyAlgorithmECDHKeyExchangeCofactorX963SHA256() |
static CFStringRef |
kSecKeyAlgorithmECDHKeyExchangeCofactorX963SHA384() |
static CFStringRef |
kSecKeyAlgorithmECDHKeyExchangeCofactorX963SHA512() |
static CFStringRef |
kSecKeyAlgorithmECDHKeyExchangeStandard() |
static CFStringRef |
kSecKeyAlgorithmECDHKeyExchangeStandardX963SHA1() |
static CFStringRef |
kSecKeyAlgorithmECDHKeyExchangeStandardX963SHA224() |
static CFStringRef |
kSecKeyAlgorithmECDHKeyExchangeStandardX963SHA256() |
static CFStringRef |
kSecKeyAlgorithmECDHKeyExchangeStandardX963SHA384() |
static CFStringRef |
kSecKeyAlgorithmECDHKeyExchangeStandardX963SHA512() |
static CFStringRef |
kSecKeyAlgorithmECDSASignatureDigestX962() |
static CFStringRef |
kSecKeyAlgorithmECDSASignatureDigestX962SHA1() |
static CFStringRef |
kSecKeyAlgorithmECDSASignatureDigestX962SHA224() |
static CFStringRef |
kSecKeyAlgorithmECDSASignatureDigestX962SHA256() |
static CFStringRef |
kSecKeyAlgorithmECDSASignatureDigestX962SHA384() |
static CFStringRef |
kSecKeyAlgorithmECDSASignatureDigestX962SHA512() |
static CFStringRef |
kSecKeyAlgorithmECDSASignatureMessageX962SHA1() |
static CFStringRef |
kSecKeyAlgorithmECDSASignatureMessageX962SHA224() |
static CFStringRef |
kSecKeyAlgorithmECDSASignatureMessageX962SHA256() |
static CFStringRef |
kSecKeyAlgorithmECDSASignatureMessageX962SHA384() |
static CFStringRef |
kSecKeyAlgorithmECDSASignatureMessageX962SHA512() |
static CFStringRef |
kSecKeyAlgorithmECDSASignatureRFC4754() |
static CFStringRef |
kSecKeyAlgorithmECIESEncryptionCofactorVariableIVX963SHA224AESGCM() |
static CFStringRef |
kSecKeyAlgorithmECIESEncryptionCofactorVariableIVX963SHA256AESGCM() |
static CFStringRef |
kSecKeyAlgorithmECIESEncryptionCofactorVariableIVX963SHA384AESGCM() |
static CFStringRef |
kSecKeyAlgorithmECIESEncryptionCofactorVariableIVX963SHA512AESGCM() |
static CFStringRef |
kSecKeyAlgorithmECIESEncryptionCofactorX963SHA1AESGCM() |
static CFStringRef |
kSecKeyAlgorithmECIESEncryptionCofactorX963SHA224AESGCM() |
static CFStringRef |
kSecKeyAlgorithmECIESEncryptionCofactorX963SHA256AESGCM() |
static CFStringRef |
kSecKeyAlgorithmECIESEncryptionCofactorX963SHA384AESGCM() |
static CFStringRef |
kSecKeyAlgorithmECIESEncryptionCofactorX963SHA512AESGCM() |
static CFStringRef |
kSecKeyAlgorithmECIESEncryptionStandardVariableIVX963SHA224AESGCM() |
static CFStringRef |
kSecKeyAlgorithmECIESEncryptionStandardVariableIVX963SHA256AESGCM() |
static CFStringRef |
kSecKeyAlgorithmECIESEncryptionStandardVariableIVX963SHA384AESGCM() |
static CFStringRef |
kSecKeyAlgorithmECIESEncryptionStandardVariableIVX963SHA512AESGCM() |
static CFStringRef |
kSecKeyAlgorithmECIESEncryptionStandardX963SHA1AESGCM() |
static CFStringRef |
kSecKeyAlgorithmECIESEncryptionStandardX963SHA224AESGCM() |
static CFStringRef |
kSecKeyAlgorithmECIESEncryptionStandardX963SHA256AESGCM() |
static CFStringRef |
kSecKeyAlgorithmECIESEncryptionStandardX963SHA384AESGCM() |
static CFStringRef |
kSecKeyAlgorithmECIESEncryptionStandardX963SHA512AESGCM() |
static CFStringRef |
kSecKeyAlgorithmRSAEncryptionOAEPSHA1() |
static CFStringRef |
kSecKeyAlgorithmRSAEncryptionOAEPSHA1AESGCM() |
static CFStringRef |
kSecKeyAlgorithmRSAEncryptionOAEPSHA224() |
static CFStringRef |
kSecKeyAlgorithmRSAEncryptionOAEPSHA224AESGCM() |
static CFStringRef |
kSecKeyAlgorithmRSAEncryptionOAEPSHA256() |
static CFStringRef |
kSecKeyAlgorithmRSAEncryptionOAEPSHA256AESGCM() |
static CFStringRef |
kSecKeyAlgorithmRSAEncryptionOAEPSHA384() |
static CFStringRef |
kSecKeyAlgorithmRSAEncryptionOAEPSHA384AESGCM() |
static CFStringRef |
kSecKeyAlgorithmRSAEncryptionOAEPSHA512() |
static CFStringRef |
kSecKeyAlgorithmRSAEncryptionOAEPSHA512AESGCM() |
static CFStringRef |
kSecKeyAlgorithmRSAEncryptionPKCS1() |
static CFStringRef |
kSecKeyAlgorithmRSAEncryptionRaw() |
static CFStringRef |
kSecKeyAlgorithmRSASignatureDigestPKCS1v15Raw() |
static CFStringRef |
kSecKeyAlgorithmRSASignatureDigestPKCS1v15SHA1() |
static CFStringRef |
kSecKeyAlgorithmRSASignatureDigestPKCS1v15SHA224() |
static CFStringRef |
kSecKeyAlgorithmRSASignatureDigestPKCS1v15SHA256() |
static CFStringRef |
kSecKeyAlgorithmRSASignatureDigestPKCS1v15SHA384() |
static CFStringRef |
kSecKeyAlgorithmRSASignatureDigestPKCS1v15SHA512() |
static CFStringRef |
kSecKeyAlgorithmRSASignatureDigestPSSSHA1() |
static CFStringRef |
kSecKeyAlgorithmRSASignatureDigestPSSSHA224() |
static CFStringRef |
kSecKeyAlgorithmRSASignatureDigestPSSSHA256() |
static CFStringRef |
kSecKeyAlgorithmRSASignatureDigestPSSSHA384() |
static CFStringRef |
kSecKeyAlgorithmRSASignatureDigestPSSSHA512() |
static CFStringRef |
kSecKeyAlgorithmRSASignatureMessagePKCS1v15SHA1() |
static CFStringRef |
kSecKeyAlgorithmRSASignatureMessagePKCS1v15SHA224() |
static CFStringRef |
kSecKeyAlgorithmRSASignatureMessagePKCS1v15SHA256() |
static CFStringRef |
kSecKeyAlgorithmRSASignatureMessagePKCS1v15SHA384() |
static CFStringRef |
kSecKeyAlgorithmRSASignatureMessagePKCS1v15SHA512() |
static CFStringRef |
kSecKeyAlgorithmRSASignatureMessagePSSSHA1() |
static CFStringRef |
kSecKeyAlgorithmRSASignatureMessagePSSSHA224() |
static CFStringRef |
kSecKeyAlgorithmRSASignatureMessagePSSSHA256() |
static CFStringRef |
kSecKeyAlgorithmRSASignatureMessagePSSSHA384() |
static CFStringRef |
kSecKeyAlgorithmRSASignatureMessagePSSSHA512() |
static CFStringRef |
kSecKeyAlgorithmRSASignatureRaw() |
static CFStringRef |
kSecKeyKeyExchangeParameterRequestedSize() |
static CFStringRef |
kSecKeyKeyExchangeParameterSharedInfo() |
static CFStringRef |
kSecMatchCaseInsensitive() |
static CFStringRef |
kSecMatchEmailAddressIfPresent() |
static CFStringRef |
kSecMatchIssuers() |
static CFStringRef |
kSecMatchItemList() |
static CFStringRef |
kSecMatchLimit() |
static CFStringRef |
kSecMatchLimitAll() |
static CFStringRef |
kSecMatchLimitOne() |
static CFStringRef |
kSecMatchPolicy()
[@enum] Search Constants
|
static CFStringRef |
kSecMatchSearchList() |
static CFStringRef |
kSecMatchSubjectContains() |
static CFStringRef |
kSecMatchTrustedOnly() |
static CFStringRef |
kSecMatchValidOnDate() |
static CFStringRef |
kSecPolicyAppleCodeSigning() |
static CFStringRef |
kSecPolicyAppleEAP() |
static CFStringRef |
kSecPolicyAppleIDValidation() |
static CFStringRef |
kSecPolicyAppleIPsec() |
static CFStringRef |
kSecPolicyApplePassbookSigning() |
static CFStringRef |
kSecPolicyApplePayIssuerEncryption() |
static CFStringRef |
kSecPolicyAppleRevocation() |
static CFStringRef |
kSecPolicyAppleSMIME() |
static CFStringRef |
kSecPolicyAppleSSL() |
static CFStringRef |
kSecPolicyAppleTimeStamping() |
static CFStringRef |
kSecPolicyAppleX509Basic()
[@enum] Policy Constants
|
static CFStringRef |
kSecPolicyClient() |
static CFStringRef |
kSecPolicyMacAppStoreReceipt() |
static CFStringRef |
kSecPolicyName() |
static CFStringRef |
kSecPolicyOid()
[@enum] Policy Value Constants
|
static CFStringRef |
kSecPolicyRevocationFlags() |
static CFStringRef |
kSecPolicyTeamIdentifier() |
static CFStringRef |
kSecPrivateKeyAttrs()
[@enum] Key Parameter Constants
|
static CFStringRef |
kSecPropertyTypeError() |
static CFStringRef |
kSecPropertyTypeTitle()
[@enum] Trust Property Constants
|
static CFStringRef |
kSecPublicKeyAttrs() |
static SecRandomRef |
kSecRandomDefault()
This is a synonym for NULL, if you'd rather use a named constant.
|
static CFStringRef |
kSecReturnAttributes() |
static CFStringRef |
kSecReturnData()
[@enum] Return Type Key Constants
|
static CFStringRef |
kSecReturnPersistentRef() |
static CFStringRef |
kSecReturnRef() |
static CFStringRef |
kSecSharedPassword()
[@enum] Credential Key Constants
|
static CFStringRef |
kSecTrustCertificateTransparency() |
static CFStringRef |
kSecTrustCertificateTransparencyWhiteList() |
static CFStringRef |
kSecTrustEvaluationDate()
[@enum] Trust Result Constants
|
static CFStringRef |
kSecTrustExtendedValidation() |
static CFStringRef |
kSecTrustOrganizationName() |
static CFStringRef |
kSecTrustResultValue() |
static CFStringRef |
kSecTrustRevocationChecked() |
static CFStringRef |
kSecTrustRevocationValidUntilDate() |
static CFStringRef |
kSecUseAuthenticationContext() |
static CFStringRef |
kSecUseAuthenticationUI() |
static CFStringRef |
kSecUseAuthenticationUIAllow()
[@enum] kSecUseAuthenticationUI Value Constants
|
static CFStringRef |
kSecUseAuthenticationUIFail() |
static CFStringRef |
kSecUseAuthenticationUISkip() |
static CFStringRef |
kSecUseDataProtectionKeychain() |
static CFStringRef |
kSecUseItemList()
[@enum] Other Constants
|
static CFStringRef |
kSecUseNoAuthenticationUI()
Deprecated.
|
static CFStringRef |
kSecUseOperationPrompt() |
static CFStringRef |
kSecValueData()
[@enum] Value Type Key Constants
|
static CFStringRef |
kSecValuePersistentRef() |
static CFStringRef |
kSecValueRef() |
static CFStringRef |
kSSLSessionConfig_3DES_fallback()
TLS v1.2 to TLS v1.0, has 3DES, no RC4
|
static CFStringRef |
kSSLSessionConfig_anonymous()
TLS v1.2, anonymous ciphersuites only
|
static CFStringRef |
kSSLSessionConfig_ATSv1_noPFS()
ATS v1 Config without PFS: TLS v1.2, include non PFS ciphersuites
|
static CFStringRef |
kSSLSessionConfig_ATSv1()
ATS v1 Config: TLS v1.2, only PFS ciphersuites
|
static CFStringRef |
kSSLSessionConfig_default()
Default configuration (has 3DES, no RC4)
|
static CFStringRef |
kSSLSessionConfig_legacy_DHE()
TLS v1.2 to TLS v1.0, default + RC4 + DHE ciphersuites
|
static CFStringRef |
kSSLSessionConfig_legacy()
TLS v1.2 to TLS v1.0, defaults + RC4 + DHE ciphersuites
|
static CFStringRef |
kSSLSessionConfig_RC4_fallback()
TLS v1.2 to TLS v1.0, with default ciphersuites + RC4 + 3DES
|
static CFStringRef |
kSSLSessionConfig_standard()
TLS v1.2 to TLS v1.0, with default ciphersuites (no 3DES, no RC4)
|
static CFStringRef |
kSSLSessionConfig_TLSv1_3DES_fallback()
TLS v1.0, with default ciphersuites + 3DES, no RC4
|
static CFStringRef |
kSSLSessionConfig_TLSv1_fallback()
TLS v1.0 only, with default ciphersuites + fallback SCSV
|
static CFStringRef |
kSSLSessionConfig_TLSv1_RC4_fallback()
TLS v1.0, with default ciphersuites + RC4 + 3DES + fallback SCSV
|
static SecCertificateRef |
sec_certificate_copy_ref(NSObject certificate)
[@function] sec_certificate_copy_ref
|
static NSObject |
sec_certificate_create(SecCertificateRef certificate)
[@function] sec_certificate_create
|
static boolean |
sec_identity_access_certificates(NSObject identity,
Security.Block_sec_identity_access_certificates handler)
[@function] sec_identity_access_certificates
|
static CFArrayRef |
sec_identity_copy_certificates_ref(NSObject identity)
[@function] sec_identity_copy_certificates_ref
|
static SecIdentityRef |
sec_identity_copy_ref(NSObject identity)
[@function] sec_identity_copy_ref
|
static NSObject |
sec_identity_create_with_certificates(SecIdentityRef identity,
CFArrayRef certificates)
[@function] sec_identity_create_with_certificates
|
static NSObject |
sec_identity_create(SecIdentityRef identity)
[@function] sec_identity_create
|
static boolean |
sec_protocol_metadata_access_distinguished_names(NSObject metadata,
Security.Block_sec_protocol_metadata_access_distinguished_names handler)
[@function] sec_protocol_metadata_access_distinguished_names
|
static boolean |
sec_protocol_metadata_access_ocsp_response(NSObject metadata,
Security.Block_sec_protocol_metadata_access_ocsp_response handler)
[@function] sec_protocol_metadata_copy_ocsp_response
|
static boolean |
sec_protocol_metadata_access_peer_certificate_chain(NSObject metadata,
Security.Block_sec_protocol_metadata_access_peer_certificate_chain handler)
[@function] sec_protocol_metadata_access_peer_certificate_chain
|
static boolean |
sec_protocol_metadata_access_pre_shared_keys(NSObject metadata,
Security.Block_sec_protocol_metadata_access_pre_shared_keys handler)
[@function] sec_protocol_metadata_access_pre_shared_keys
|
static boolean |
sec_protocol_metadata_access_supported_signature_algorithms(NSObject metadata,
Security.Block_sec_protocol_metadata_access_supported_signature_algorithms handler)
[@function] sec_protocol_metadata_access_supported_signature_algorithms
|
static boolean |
sec_protocol_metadata_challenge_parameters_are_equal(NSObject metadataA,
NSObject metadataB)
[@function] sec_protocol_metadata_challenge_parameters_are_equal
|
static NSObject |
sec_protocol_metadata_copy_peer_public_key(NSObject metadata)
[@function] sec_protocol_metadata_copy_peer_public_key
|
static NSObject |
sec_protocol_metadata_create_secret_with_context(NSObject metadata,
long label_len,
java.lang.String label,
long context_len,
java.lang.String context,
long exporter_length)
[@function] sec_protocol_metadata_create_secret_with_context
|
static NSObject |
sec_protocol_metadata_create_secret(NSObject metadata,
long label_len,
java.lang.String label,
long exporter_length)
[@function] sec_protocol_metadata_create_secret
|
static boolean |
sec_protocol_metadata_get_early_data_accepted(NSObject metadata)
[@function] sec_protocol_metadata_get_early_data_accepted
|
static char |
sec_protocol_metadata_get_negotiated_ciphersuite(NSObject metadata)
[@function] sec_protocol_metadata_get_negotiated_ciphersuite
|
static int |
sec_protocol_metadata_get_negotiated_protocol_version(NSObject metadata)
[@function] sec_protocol_metadata_get_negotiated_protocol_version
|
static java.lang.String |
sec_protocol_metadata_get_negotiated_protocol(NSObject metadata)
[@function] sec_protocol_metadata_get_negotiated_protocol
|
static short |
sec_protocol_metadata_get_negotiated_tls_ciphersuite(NSObject metadata)
[@function] sec_protocol_metadata_get_negotiated_tls_ciphersuite
|
static short |
sec_protocol_metadata_get_negotiated_tls_protocol_version(NSObject metadata)
[@function] sec_protocol_metadata_get_negotiated_tls_protocol_version
|
static java.lang.String |
sec_protocol_metadata_get_server_name(NSObject metadata)
[@function] sec_protocol_metadata_get_server_name
|
static boolean |
sec_protocol_metadata_peers_are_equal(NSObject metadataA,
NSObject metadataB)
[@function] sec_protocol_metadata_peers_are_equal
|
static void |
sec_protocol_options_add_pre_shared_key(NSObject options,
NSObject psk,
NSObject psk_identity)
[@function] sec_protocol_options_add_pre_shared_key
|
static void |
sec_protocol_options_add_tls_application_protocol(NSObject options,
java.lang.String application_protocol)
[@function] sec_protocol_options_add_tls_application_protocol
|
static void |
sec_protocol_options_add_tls_ciphersuite_group(NSObject options,
int group)
[@function] sec_protocol_options_add_tls_ciphersuite_group
|
static void |
sec_protocol_options_add_tls_ciphersuite(NSObject options,
char ciphersuite)
[@function] sec_protocol_options_add_tls_ciphersuite
|
static void |
sec_protocol_options_append_tls_ciphersuite_group(NSObject options,
short group)
[@function] sec_protocol_options_append_tls_ciphersuite_group
|
static void |
sec_protocol_options_append_tls_ciphersuite(NSObject options,
short ciphersuite)
[@function] sec_protocol_options_append_tls_ciphersuite
|
static boolean |
sec_protocol_options_are_equal(NSObject optionsA,
NSObject optionsB)
[@function] sec_protocol_options_are_equal
|
static short |
sec_protocol_options_get_default_max_dtls_protocol_version()
[@function] sec_protocol_options_get_default_max_tls_protocol_version
|
static short |
sec_protocol_options_get_default_max_tls_protocol_version()
[@function] sec_protocol_options_get_default_max_tls_protocol_version
|
static short |
sec_protocol_options_get_default_min_dtls_protocol_version()
[@function] sec_protocol_options_get_default_min_dtls_protocol_version
|
static short |
sec_protocol_options_get_default_min_tls_protocol_version()
[@function] sec_protocol_options_get_default_min_tls_protocol_version
|
static void |
sec_protocol_options_set_challenge_block(NSObject options,
Security.Block_sec_protocol_options_set_challenge_block challenge_block,
NSObject challenge_queue)
[@function] sec_protocol_options_set_challenge_block
|
static void |
sec_protocol_options_set_key_update_block(NSObject options,
Security.Block_sec_protocol_options_set_key_update_block key_update_block,
NSObject key_update_queue)
[@function] sec_protocol_options_set_key_update_block
|
static void |
sec_protocol_options_set_local_identity(NSObject options,
NSObject identity)
[@function] sec_protocol_options_set_local_identity
|
static void |
sec_protocol_options_set_max_tls_protocol_version(NSObject options,
short version)
[@function] sec_protocol_options_set_max_tls_protocol_version
|
static void |
sec_protocol_options_set_min_tls_protocol_version(NSObject options,
short version)
[@function] sec_protocol_options_set_min_tls_protocol_version
|
static void |
sec_protocol_options_set_peer_authentication_required(NSObject options,
boolean peer_authentication_required)
[@function] sec_protocol_options_set_peer_authentication_required
|
static void |
sec_protocol_options_set_pre_shared_key_selection_block(NSObject options,
Security.Block_sec_protocol_options_set_pre_shared_key_selection_block psk_selection_block,
NSObject psk_selection_queue)
[@function] sec_protocol_options_set_pre_shared_key_selection_block
|
static void |
sec_protocol_options_set_tls_diffie_hellman_parameters(NSObject options,
NSObject params)
[@function] sec_protocol_options_set_tls_diffie_hellman_parameters
|
static void |
sec_protocol_options_set_tls_false_start_enabled(NSObject options,
boolean false_start_enabled)
[@function] sec_protocol_options_set_tls_false_start_enabled
|
static void |
sec_protocol_options_set_tls_is_fallback_attempt(NSObject options,
boolean is_fallback_attempt)
[@function] sec_protocol_options_set_tls_is_fallback_attempt
|
static void |
sec_protocol_options_set_tls_max_version(NSObject options,
int version)
[@function] sec_protocol_options_set_tls_max_version
|
static void |
sec_protocol_options_set_tls_min_version(NSObject options,
int version)
[@function] sec_protocol_options_set_tls_min_version
|
static void |
sec_protocol_options_set_tls_ocsp_enabled(NSObject options,
boolean ocsp_enabled)
[@function] nw_protocol_options_set_tls_ocsp_enabled
|
static void |
sec_protocol_options_set_tls_pre_shared_key_identity_hint(NSObject options,
NSObject psk_identity_hint)
[@function] sec_protocol_options_set_tls_pre_shared_key_identity_hint
|
static void |
sec_protocol_options_set_tls_renegotiation_enabled(NSObject options,
boolean renegotiation_enabled)
[@function] sec_protocol_options_set_tls_renegotiation_enabled
|
static void |
sec_protocol_options_set_tls_resumption_enabled(NSObject options,
boolean resumption_enabled)
[@function] sec_protocol_options_set_tls_resumption_enabled
|
static void |
sec_protocol_options_set_tls_sct_enabled(NSObject options,
boolean sct_enabled)
[@function] sec_protocol_options_set_tls_sct_enabled
|
static void |
sec_protocol_options_set_tls_server_name(NSObject options,
java.lang.String server_name)
[@function] sec_protocol_options_set_tls_server_name
|
static void |
sec_protocol_options_set_tls_tickets_enabled(NSObject options,
boolean tickets_enabled)
[@function] sec_protocol_options_set_tls_tickets_enabled
|
static void |
sec_protocol_options_set_verify_block(NSObject options,
Security.Block_sec_protocol_options_set_verify_block verify_block,
NSObject verify_block_queue)
[@function] sec_protocol_options_set_verify_block
|
static SecTrustRef |
sec_trust_copy_ref(NSObject trust)
[@function] sec_trust_copy_ref
|
static NSObject |
sec_trust_create(SecTrustRef trust)
[@function] sec_trust_create
|
static SecAccessControlRef |
SecAccessControlCreateWithFlags(CFAllocatorRef allocator,
org.moe.natj.general.ptr.ConstVoidPtr protection,
long flags,
org.moe.natj.general.ptr.Ptr<CFErrorRef> error)
[@function] SecAccessControlCreateWithFlags
|
static long |
SecAccessControlGetTypeID()
[@function] SecAccessControlGetTypeID
|
static void |
SecAddSharedWebCredential(CFStringRef fqdn,
CFStringRef account,
CFStringRef password,
Security.Block_SecAddSharedWebCredential completionHandler)
[@function] SecAddSharedWebCredential
|
static int |
SecCertificateCopyCommonName(SecCertificateRef certificate,
org.moe.natj.general.ptr.Ptr<CFStringRef> commonName)
[@function] SecCertificateCopyCommonName
|
static CFDataRef |
SecCertificateCopyData(SecCertificateRef certificate)
[@function] SecCertificateCopyData
|
static int |
SecCertificateCopyEmailAddresses(SecCertificateRef certificate,
org.moe.natj.general.ptr.Ptr<CFArrayRef> emailAddresses)
[@function] SecCertificateCopyEmailAddresses
|
static SecKeyRef |
SecCertificateCopyKey(SecCertificateRef certificate)
[@function] SecCertificateCopyKey
|
static CFDataRef |
SecCertificateCopyNormalizedIssuerSequence(SecCertificateRef certificate)
[@function] SecCertificateCopyNormalizedIssuerSequence
|
static CFDataRef |
SecCertificateCopyNormalizedSubjectSequence(SecCertificateRef certificate)
[@function] SecCertificateCopyNormalizedSubjectSequence
|
static SecKeyRef |
SecCertificateCopyPublicKey(SecCertificateRef certificate)
[@function] SecCertificateCopyPublicKey
|
static CFDataRef |
SecCertificateCopySerialNumber(SecCertificateRef certificate)
[@function] SecCertificateCopySerialNumber
|
static CFDataRef |
SecCertificateCopySerialNumberData(SecCertificateRef certificate,
org.moe.natj.general.ptr.Ptr<CFErrorRef> error)
[@function] SecCertificateCopySerialNumberData
|
static CFStringRef |
SecCertificateCopySubjectSummary(SecCertificateRef certificate)
[@function] SecCertificateCopySubjectSummary
|
static SecCertificateRef |
SecCertificateCreateWithData(CFAllocatorRef allocator,
CFDataRef data)
[@function] SecCertificateCreateWithData
|
static long |
SecCertificateGetTypeID()
[@function] SecCertificateGetTypeID
|
static CFStringRef |
SecCopyErrorMessageString(int status,
org.moe.natj.general.ptr.VoidPtr reserved)
[@function] SecCopyErrorMessageString
|
static CFStringRef |
SecCreateSharedWebCredentialPassword()
[@function] SecCreateSharedWebCredentialPassword
|
static int |
SecIdentityCopyCertificate(SecIdentityRef identityRef,
org.moe.natj.general.ptr.Ptr<SecCertificateRef> certificateRef)
[@function] SecIdentityCopyCertificate
|
static int |
SecIdentityCopyPrivateKey(SecIdentityRef identityRef,
org.moe.natj.general.ptr.Ptr<SecKeyRef> privateKeyRef)
[@function] SecIdentityCopyPrivateKey
|
static long |
SecIdentityGetTypeID()
[@function] SecIdentityGetTypeID
|
static int |
SecItemAdd(CFDictionaryRef attributes,
org.moe.natj.general.ptr.Ptr<org.moe.natj.general.ptr.ConstVoidPtr> result)
[@function] SecItemAdd
|
static int |
SecItemCopyMatching(CFDictionaryRef query,
org.moe.natj.general.ptr.Ptr<org.moe.natj.general.ptr.ConstVoidPtr> result)
[@function] SecItemCopyMatching
|
static int |
SecItemDelete(CFDictionaryRef query)
[@function] SecItemDelete
|
static int |
SecItemUpdate(CFDictionaryRef query,
CFDictionaryRef attributesToUpdate)
[@function] SecItemUpdate
|
static CFDictionaryRef |
SecKeyCopyAttributes(SecKeyRef key)
[@function] SecKeyCopyAttributes
|
static CFDataRef |
SecKeyCopyExternalRepresentation(SecKeyRef key,
org.moe.natj.general.ptr.Ptr<CFErrorRef> error)
[@function] SecKeyCopyExternalRepresentation
|
static CFDataRef |
SecKeyCopyKeyExchangeResult(SecKeyRef privateKey,
CFStringRef algorithm,
SecKeyRef publicKey,
CFDictionaryRef parameters,
org.moe.natj.general.ptr.Ptr<CFErrorRef> error)
[@function] SecKeyCopyKeyExchangeResult
|
static SecKeyRef |
SecKeyCopyPublicKey(SecKeyRef key)
[@function] SecKeyCopyPublicKey
|
static CFDataRef |
SecKeyCreateDecryptedData(SecKeyRef key,
CFStringRef algorithm,
CFDataRef ciphertext,
org.moe.natj.general.ptr.Ptr<CFErrorRef> error)
[@function] SecKeyCreateDecryptedData
|
static CFDataRef |
SecKeyCreateEncryptedData(SecKeyRef key,
CFStringRef algorithm,
CFDataRef plaintext,
org.moe.natj.general.ptr.Ptr<CFErrorRef> error)
[@function] SecKeyCreateEncryptedData
|
static SecKeyRef |
SecKeyCreateRandomKey(CFDictionaryRef parameters,
org.moe.natj.general.ptr.Ptr<CFErrorRef> error)
[@function] SecKeyCreateRandomKey
|
static CFDataRef |
SecKeyCreateSignature(SecKeyRef key,
CFStringRef algorithm,
CFDataRef dataToSign,
org.moe.natj.general.ptr.Ptr<CFErrorRef> error)
[@function] SecKeyCreateSignature
|
static SecKeyRef |
SecKeyCreateWithData(CFDataRef keyData,
CFDictionaryRef attributes,
org.moe.natj.general.ptr.Ptr<CFErrorRef> error)
[@function] SecKeyCreateWithData
|
static int |
SecKeyDecrypt(SecKeyRef key,
int padding,
java.lang.String cipherText,
long cipherTextLen,
org.moe.natj.general.ptr.BytePtr plainText,
org.moe.natj.general.ptr.NUIntPtr plainTextLen)
[@function] SecKeyDecrypt
|
static int |
SecKeyEncrypt(SecKeyRef key,
int padding,
java.lang.String plainText,
long plainTextLen,
org.moe.natj.general.ptr.BytePtr cipherText,
org.moe.natj.general.ptr.NUIntPtr cipherTextLen)
[@function] SecKeyEncrypt
|
static int |
SecKeyGeneratePair(CFDictionaryRef parameters,
org.moe.natj.general.ptr.Ptr<SecKeyRef> publicKey,
org.moe.natj.general.ptr.Ptr<SecKeyRef> privateKey)
[@function] SecKeyGeneratePair
|
static long |
SecKeyGetBlockSize(SecKeyRef key)
[@function] SecKeyGetBlockSize
|
static long |
SecKeyGetTypeID()
[@function] SecKeyGetTypeID
|
static byte |
SecKeyIsAlgorithmSupported(SecKeyRef key,
long operation,
CFStringRef algorithm)
[@function] SecKeyIsAlgorithmSupported
|
static int |
SecKeyRawSign(SecKeyRef key,
int padding,
java.lang.String dataToSign,
long dataToSignLen,
org.moe.natj.general.ptr.BytePtr sig,
org.moe.natj.general.ptr.NUIntPtr sigLen)
[@function] SecKeyRawSign
|
static int |
SecKeyRawVerify(SecKeyRef key,
int padding,
java.lang.String signedData,
long signedDataLen,
java.lang.String sig,
long sigLen)
[@function] SecKeyRawVerify
|
static byte |
SecKeyVerifySignature(SecKeyRef key,
CFStringRef algorithm,
CFDataRef signedData,
CFDataRef signature,
org.moe.natj.general.ptr.Ptr<CFErrorRef> error)
[@function] SecKeyVerifySignature
|
static int |
SecPKCS12Import(CFDataRef pkcs12_data,
CFDictionaryRef options,
org.moe.natj.general.ptr.Ptr<CFArrayRef> items)
[@function] SecPKCS12Import
|
static CFDictionaryRef |
SecPolicyCopyProperties(SecPolicyRef policyRef)
[@function] SecPolicyCopyProperties
|
static SecPolicyRef |
SecPolicyCreateBasicX509()
[@function] SecPolicyCreateBasicX509
|
static SecPolicyRef |
SecPolicyCreateRevocation(long revocationFlags)
[@function] SecPolicyCreateRevocation
|
static SecPolicyRef |
SecPolicyCreateSSL(byte server,
CFStringRef hostname)
[@function] SecPolicyCreateSSL
|
static SecPolicyRef |
SecPolicyCreateWithProperties(org.moe.natj.general.ptr.ConstVoidPtr policyIdentifier,
CFDictionaryRef properties)
[@function] SecPolicyCreateWithProperties
|
static long |
SecPolicyGetTypeID()
[@function] SecPolicyGetTypeID
|
static int |
SecRandomCopyBytes(SecRandomRef rnd,
long count,
org.moe.natj.general.ptr.VoidPtr bytes)
[@function] SecRandomCopyBytes
|
static void |
SecRequestSharedWebCredential(CFStringRef fqdn,
CFStringRef account,
Security.Block_SecRequestSharedWebCredential completionHandler)
[@function] SecRequestSharedWebCredential
|
static CFArrayRef |
SecTrustCopyCertificateChain(SecTrustRef trust)
[@function] SecTrustCopyCertificateChain
|
static int |
SecTrustCopyCustomAnchorCertificates(SecTrustRef trust,
org.moe.natj.general.ptr.Ptr<CFArrayRef> anchors)
[@function] SecTrustCopyCustomAnchorCertificates
|
static CFDataRef |
SecTrustCopyExceptions(SecTrustRef trust)
[@function] SecTrustCopyExceptions
|
static SecKeyRef |
SecTrustCopyKey(SecTrustRef trust)
[@function] SecTrustCopyKey
|
static int |
SecTrustCopyPolicies(SecTrustRef trust,
org.moe.natj.general.ptr.Ptr<CFArrayRef> policies)
[@function] SecTrustCopyPolicies
|
static CFArrayRef |
SecTrustCopyProperties(SecTrustRef trust)
[@function] SecTrustCopyProperties
|
static SecKeyRef |
SecTrustCopyPublicKey(SecTrustRef trust)
[@function] SecTrustCopyPublicKey
|
static CFDictionaryRef |
SecTrustCopyResult(SecTrustRef trust)
[@function] SecTrustCopyResult
|
static int |
SecTrustCreateWithCertificates(org.moe.natj.general.ptr.ConstVoidPtr certificates,
org.moe.natj.general.ptr.ConstVoidPtr policies,
org.moe.natj.general.ptr.Ptr<SecTrustRef> trust)
[@function] SecTrustCreateWithCertificates
|
static int |
SecTrustEvaluate(SecTrustRef trust,
org.moe.natj.general.ptr.IntPtr result)
[@function] SecTrustEvaluate
|
static int |
SecTrustEvaluateAsync(SecTrustRef trust,
NSObject queue,
Security.Block_SecTrustEvaluateAsync result)
[@function] SecTrustEvaluateAsync
|
static int |
SecTrustEvaluateAsyncWithError(SecTrustRef trust,
NSObject queue,
Security.Block_SecTrustEvaluateAsyncWithError result)
[@function] SecTrustEvaluateAsyncWithError
|
static boolean |
SecTrustEvaluateWithError(SecTrustRef trust,
org.moe.natj.general.ptr.Ptr<CFErrorRef> error)
[@function] SecTrustEvaluateWithError
|
static SecCertificateRef |
SecTrustGetCertificateAtIndex(SecTrustRef trust,
long ix)
[@function] SecTrustGetCertificateAtIndex
|
static long |
SecTrustGetCertificateCount(SecTrustRef trust)
[@function] SecTrustGetCertificateCount
|
static int |
SecTrustGetNetworkFetchAllowed(SecTrustRef trust,
org.moe.natj.general.ptr.BytePtr allowFetch)
[@function] SecTrustGetNetworkFetchAllowed
|
static int |
SecTrustGetTrustResult(SecTrustRef trust,
org.moe.natj.general.ptr.IntPtr result)
[@function] SecTrustGetTrustResult
|
static long |
SecTrustGetTypeID()
[@function] SecTrustGetTypeID
|
static double |
SecTrustGetVerifyTime(SecTrustRef trust)
[@function] SecTrustGetVerifyTime
|
static int |
SecTrustSetAnchorCertificates(SecTrustRef trust,
CFArrayRef anchorCertificates)
[@function] SecTrustSetAnchorCertificates
|
static int |
SecTrustSetAnchorCertificatesOnly(SecTrustRef trust,
byte anchorCertificatesOnly)
[@function] SecTrustSetAnchorCertificatesOnly
|
static boolean |
SecTrustSetExceptions(SecTrustRef trust,
CFDataRef exceptions)
[@function] SecTrustSetExceptions
|
static int |
SecTrustSetNetworkFetchAllowed(SecTrustRef trust,
byte allowFetch)
[@function] SecTrustSetNetworkFetchAllowed
|
static int |
SecTrustSetOCSPResponse(SecTrustRef trust,
org.moe.natj.general.ptr.ConstVoidPtr responseData)
[@function] SecTrustSetOCSPResponse
|
static int |
SecTrustSetPolicies(SecTrustRef trust,
org.moe.natj.general.ptr.ConstVoidPtr policies)
[@function] SecTrustSetPolicies
|
static int |
SecTrustSetSignedCertificateTimestamps(SecTrustRef trust,
CFArrayRef sctArray)
[@function] SecTrustSignedCertificateTimestamps
|
static int |
SecTrustSetVerifyDate(SecTrustRef trust,
CFDateRef verifyDate)
[@function] SecTrustSetVerifyDate
|
static int |
SSLAddDistinguishedName(SSLContextRef context,
org.moe.natj.general.ptr.ConstVoidPtr derDN,
long derDNLen)
[@function] SSLAddDistinguishedName
|
static int |
SSLClose(SSLContextRef context)
[@function] SSLClose
|
static long |
SSLContextGetTypeID()
[@function] SSLContextGetTypeID
|
static int |
SSLCopyALPNProtocols(SSLContextRef context,
org.moe.natj.general.ptr.Ptr<CFArrayRef> protocols)
[@function] SSLCopyALPNProtocols
|
static int |
SSLCopyDistinguishedNames(SSLContextRef context,
org.moe.natj.general.ptr.Ptr<CFArrayRef> names)
[@function] SSLCopyDistinguishedNames
|
static int |
SSLCopyPeerTrust(SSLContextRef context,
org.moe.natj.general.ptr.Ptr<SecTrustRef> trust)
[@function] SSLCopyPeerTrust
|
static int |
SSLCopyRequestedPeerName(SSLContextRef context,
org.moe.natj.general.ptr.BytePtr peerName,
org.moe.natj.general.ptr.NUIntPtr peerNameLen)
[@function] SSLCopyRequestedPeerName
|
static int |
SSLCopyRequestedPeerNameLength(SSLContextRef ctx,
org.moe.natj.general.ptr.NUIntPtr peerNameLen)
[@function] SSLCopyRequestedPeerNameLength
|
static SSLContextRef |
SSLCreateContext(CFAllocatorRef alloc,
int protocolSide,
int connectionType)
[@function] SSLCreateContext
|
static int |
SSLGetBufferedReadSize(SSLContextRef context,
org.moe.natj.general.ptr.NUIntPtr bufferSize)
[@function] SSLGetBufferedReadSize
|
static int |
SSLGetClientCertificateState(SSLContextRef context,
org.moe.natj.general.ptr.IntPtr clientState)
[@function] SSLGetClientCertificateState
|
static int |
SSLGetConnection(SSLContextRef context,
org.moe.natj.general.ptr.Ptr<org.moe.natj.general.ptr.ConstVoidPtr> connection)
[@function] SSLGetConnection
|
static int |
SSLGetDatagramWriteSize(SSLContextRef dtlsContext,
org.moe.natj.general.ptr.NUIntPtr bufSize)
[@function] SSLGetDatagramWriteSize
|
static int |
SSLGetEnabledCiphers(SSLContextRef context,
org.moe.natj.general.ptr.CharPtr ciphers,
org.moe.natj.general.ptr.NUIntPtr numCiphers)
[@function] SSLGetEnabledCiphers
|
static int |
SSLGetMaxDatagramRecordSize(SSLContextRef dtlsContext,
org.moe.natj.general.ptr.NUIntPtr maxSize)
[@function] SSLGetMaxDatagramRecordSize
|
static int |
SSLGetNegotiatedCipher(SSLContextRef context,
org.moe.natj.general.ptr.CharPtr cipherSuite)
[@function] SSLGetNegotiatedCipher
|
static int |
SSLGetNegotiatedProtocolVersion(SSLContextRef context,
org.moe.natj.general.ptr.IntPtr protocol)
[@function] SSLGetNegotiatedProtocolVersion
|
static int |
SSLGetNumberEnabledCiphers(SSLContextRef context,
org.moe.natj.general.ptr.NUIntPtr numCiphers)
[@function] SSLGetNumberEnabledCiphers
|
static int |
SSLGetNumberSupportedCiphers(SSLContextRef context,
org.moe.natj.general.ptr.NUIntPtr numCiphers)
[@function] SSLGetNumberSupportedCiphers
|
static int |
SSLGetPeerDomainName(SSLContextRef context,
org.moe.natj.general.ptr.BytePtr peerName,
org.moe.natj.general.ptr.NUIntPtr peerNameLen)
[@function] SSLGetPeerDomainName
|
static int |
SSLGetPeerDomainNameLength(SSLContextRef context,
org.moe.natj.general.ptr.NUIntPtr peerNameLen)
[@function] SSLGetPeerDomainNameLength
|
static int |
SSLGetPeerID(SSLContextRef context,
org.moe.natj.general.ptr.Ptr<org.moe.natj.general.ptr.ConstVoidPtr> peerID,
org.moe.natj.general.ptr.NUIntPtr peerIDLen)
[@function] SSLGetPeerID
|
static int |
SSLGetProtocolVersionMax(SSLContextRef context,
org.moe.natj.general.ptr.IntPtr maxVersion)
[@function] SSLGetProtocolVersionMax
|
static int |
SSLGetProtocolVersionMin(SSLContextRef context,
org.moe.natj.general.ptr.IntPtr minVersion)
[@function] SSLGetProtocolVersionMin
|
static int |
SSLGetSessionOption(SSLContextRef context,
int option,
org.moe.natj.general.ptr.BytePtr value)
[@function] SSLGetSessionOption
|
static int |
SSLGetSessionState(SSLContextRef context,
org.moe.natj.general.ptr.IntPtr state)
[@function] SSLGetSessionState
|
static int |
SSLGetSupportedCiphers(SSLContextRef context,
org.moe.natj.general.ptr.CharPtr ciphers,
org.moe.natj.general.ptr.NUIntPtr numCiphers)
[@function] SSLGetSupportedCiphers
|
static int |
SSLHandshake(SSLContextRef context)
[@function] SSLHandshake
|
static int |
SSLRead(SSLContextRef context,
org.moe.natj.general.ptr.VoidPtr data,
long dataLength,
org.moe.natj.general.ptr.NUIntPtr processed)
[@function] SSLRead
|
static int |
SSLReHandshake(SSLContextRef context)
[@function] SSLReHandshake
|
static int |
SSLSetALPNProtocols(SSLContextRef context,
CFArrayRef protocols)
[@function] SSLSetALPNProtocols
|
static int |
SSLSetCertificate(SSLContextRef context,
CFArrayRef certRefs)
[@function] SSLSetCertificate
|
static int |
SSLSetClientSideAuthenticate(SSLContextRef context,
int auth)
[@function] SSLSetClientSideAuthenticate
|
static int |
SSLSetConnection(SSLContextRef context,
org.moe.natj.general.ptr.ConstVoidPtr connection)
[@function] SSLSetConnection
|
static int |
SSLSetDatagramHelloCookie(SSLContextRef dtlsContext,
org.moe.natj.general.ptr.ConstVoidPtr cookie,
long cookieLen)
[@function] SSLSetDatagramHelloCookie
|
static int |
SSLSetEnabledCiphers(SSLContextRef context,
org.moe.natj.general.ptr.ConstCharPtr ciphers,
long numCiphers)
[@function] SSLSetEnabledCiphers
|
static int |
SSLSetEncryptionCertificate(SSLContextRef context,
CFArrayRef certRefs)
Deprecated.
|
static int |
SSLSetError(SSLContextRef context,
int status)
[@function] SSLSetError
|
static int |
SSLSetIOFuncs(SSLContextRef context,
Security.Function_SSLSetIOFuncs_1 readFunc,
Security.Function_SSLSetIOFuncs_2 writeFunc)
[@function] SSLSetIOFuncs
|
static int |
SSLSetMaxDatagramRecordSize(SSLContextRef dtlsContext,
long maxSize)
[@function] SSLSetMaxDatagramRecordSize
|
static int |
SSLSetOCSPResponse(SSLContextRef context,
CFDataRef response)
[@function] SSLSetOCSPResponse
|
static int |
SSLSetPeerDomainName(SSLContextRef context,
java.lang.String peerName,
long peerNameLen)
[@function] SSLSetPeerDomainName
|
static int |
SSLSetPeerID(SSLContextRef context,
org.moe.natj.general.ptr.ConstVoidPtr peerID,
long peerIDLen)
[@function] SSLSetPeerID
|
static int |
SSLSetProtocolVersionMax(SSLContextRef context,
int maxVersion)
[@function] SSLSetProtocolVersionMax
|
static int |
SSLSetProtocolVersionMin(SSLContextRef context,
int minVersion)
[@function] SSLSetProtocolVersionMin
|
static int |
SSLSetSessionConfig(SSLContextRef context,
CFStringRef config)
[@function] SSLSetSessionConfig
[@absttact] Set a predefined configuration for the SSL Session
[@note] This currently affect enabled protocol versions,
enabled ciphersuites, and the kSSLSessionOptionFallback
session option.
|
static int |
SSLSetSessionOption(SSLContextRef context,
int option,
byte value)
[@function] SSLSetSessionOption
|
static int |
SSLSetSessionTicketsEnabled(SSLContextRef context,
byte enabled)
[@function] SSLSetSessionTicketsEnabled
|
static int |
SSLWrite(SSLContextRef context,
org.moe.natj.general.ptr.ConstVoidPtr data,
long dataLength,
org.moe.natj.general.ptr.NUIntPtr processed)
[@function] SSLWrite
|
public static long SecCertificateGetTypeID()
Returns the type identifier of SecCertificate instances.
public static SecCertificateRef SecCertificateCreateWithData(CFAllocatorRef allocator, CFDataRef data)
Create a certificate given it's DER representation as a CFData.
allocator - CFAllocator to allocate the certificate with.data - DER encoded X.509 certificate.public static CFDataRef SecCertificateCopyData(SecCertificateRef certificate)
Return the DER representation of an X.509 certificate.
certificate - SecCertificate object created with
SecCertificateCreateWithData().public static CFStringRef SecCertificateCopySubjectSummary(SecCertificateRef certificate)
Return a simple string which hopefully represents a human understandable summary.
All the data in this string comes from the certificate itself and thus it's in whatever language the certificate itself is in.
certificate - A reference to the certificate from which to derive
the subject summary string.public static long SecIdentityGetTypeID()
Returns the type identifier of SecIdentity instances.
public static int SecIdentityCopyCertificate(SecIdentityRef identityRef, org.moe.natj.general.ptr.Ptr<SecCertificateRef> certificateRef)
Returns a reference to a certificate for the given identity reference.
identityRef - An identity reference.certificateRef - On return, a pointer to the found certificate
reference. You are responsible for releasing this reference by calling
the CFRelease function.public static int SecIdentityCopyPrivateKey(SecIdentityRef identityRef, org.moe.natj.general.ptr.Ptr<SecKeyRef> privateKeyRef)
Returns the private key associated with an identity.
identityRef - An identity reference.privateKeyRef - On return, a pointer to the private key for the given
identity. On iOS, the private key must be of class type kSecAppleKeyItemClass.
You are responsible for releasing this reference by calling the CFRelease function.public static int SecPKCS12Import(CFDataRef pkcs12_data, CFDictionaryRef options, org.moe.natj.general.ptr.Ptr<CFArrayRef> items)
Imports the contents of a PKCS12 formatted blob.
pkcs12_data - The PKCS#12 formatted data to be imported.options - A dictionary containing import options. A
kSecImportExportPassphrase entry is required at minimum. Only password-based
PKCS12 blobs are currently supported.items - On return, an array containing a dictionary for every item
extracted. Use kSecImportItem constants to access specific elements of
these dictionaries. Your code must CFRelease the array when it is no longer
needed.public static long SecAccessControlGetTypeID()
Returns the type identifier of SecAccessControl instances.
public static SecAccessControlRef SecAccessControlCreateWithFlags(CFAllocatorRef allocator, org.moe.natj.general.ptr.ConstVoidPtr protection, long flags, org.moe.natj.general.ptr.Ptr<CFErrorRef> error)
Creates new access control object based on protection type and additional flags.
Created access control object should be used as a value for kSecAttrAccessControl attribute in SecItemAdd, SecItemUpdate or SecKeyGeneratePair functions. Accessing keychain items or performing operations on keys which are protected by access control objects can block the execution because of UI which can appear to satisfy the access control conditions, therefore it is recommended to either move those potentially blocking operations out of the main application thread or use combination of kSecUseAuthenticationContext and kSecUseAuthenticationUI attributes to control where the UI interaction can appear.
allocator - Allocator to be used by this instance.protection - Protection class to be used for the item. One of kSecAttrAccessible constants.flags - If no flags are set then all operations are allowed.error - Additional error information filled in case of failure.public static int SecItemCopyMatching(CFDictionaryRef query, org.moe.natj.general.ptr.Ptr<org.moe.natj.general.ptr.ConstVoidPtr> result)
Returns one or more items which match a search query.
Attributes defining a search are specified by adding key/value pairs to the query dictionary.
A typical query consists of:
* a kSecClass key, whose value is a constant from the Class Constants section that specifies the class of item(s) to be searched * one or more keys from the "Attribute Key Constants" section, whose value is the attribute data to be matched * one or more keys from the "Search Constants" section, whose value is used to further refine the search * a key from the "Return Type Key Constants" section, specifying the type of results desired
Result types are specified as follows:
* To obtain the data of a matching item (CFDataRef), specify kSecReturnData with a value of kCFBooleanTrue. * To obtain the attributes of a matching item (CFDictionaryRef), specify kSecReturnAttributes with a value of kCFBooleanTrue. * To obtain a reference to a matching item (SecKeychainItemRef, SecKeyRef, SecCertificateRef, or SecIdentityRef), specify kSecReturnRef with a value of kCFBooleanTrue. * To obtain a persistent reference to a matching item (CFDataRef), specify kSecReturnPersistentRef with a value of kCFBooleanTrue. Note that unlike normal references, a persistent reference may be stored on disk or passed between processes. * If more than one of these result types is specified, the result is returned as a CFDictionaryRef containing all the requested data. * If a result type is not specified, no results are returned.
By default, this function returns only the first match found. To obtain more than one matching item at a time, specify kSecMatchLimit with a value greater than 1. The result will be a CFArrayRef containing up to that number of matching items; the items' types are described above.
To filter a provided list of items down to those matching the query, specify a kSecMatchItemList whose value is a CFArray of SecKeychainItemRef, SecKeyRef, SecCertificateRef, or SecIdentityRef items. The objects in the provided array must be of the same type.
On iOS, to convert from a persistent item reference to a normal item reference, specify a kSecValuePersistentRef whose value a CFDataRef (the persistent reference), and a kSecReturnRef whose value is kCFBooleanTrue.
On OSX, to convert from persistent item references to normal item references, specify a kSecMatchItemList whose value is a CFArray containing one or more CFDataRef elements (the persistent reference), and a kSecReturnRef whose value is kCFBooleanTrue. The objects in the provided array must be of the same type.
query - A dictionary containing an item class specification and
optional attributes for controlling the search. See the "Keychain
Search Attributes" section for a description of currently defined
search attributes.result - On return, a CFTypeRef reference to the found item(s). The
exact type of the result is based on the search attributes supplied
in the query, as discussed below.public static int SecItemAdd(CFDictionaryRef attributes, org.moe.natj.general.ptr.Ptr<org.moe.natj.general.ptr.ConstVoidPtr> result)
Add one or more items to a keychain.
Attributes defining an item are specified by adding key/value pairs to the attributes dictionary. To add multiple items to a keychain at once use the kSecUseItemList key with an array of items as its value. This is currently only supported for non password items.
On OSX, To add an item to a particular keychain, supply kSecUseKeychain with a SecKeychainRef as its value.
Result types are specified as follows:
* To obtain the data of the added item (CFDataRef), specify kSecReturnData with a value of kCFBooleanTrue. * To obtain all the attributes of the added item (CFDictionaryRef), specify kSecReturnAttributes with a value of kCFBooleanTrue. * To obtain a reference to the added item (SecKeychainItemRef, SecKeyRef, SecCertiicateRef, or SecIdentityRef), specify kSecReturnRef with a value of kCFBooleanTrue. * To obtain a persistent reference to the added item (CFDataRef), specify kSecReturnPersistentRef with a value of kCFBooleanTrue. Note that unlike normal references, a persistent reference may be stored on disk or passed between processes. * If more than one of these result types is specified, the result is returned as a CFDictionaryRef containing all the requested data. * On iOS, if a result type is not specified, no results are returned. On OSX, the added item is returned.
attributes - A dictionary containing an item class specification and
optional entries specifying the item's attribute values. See the
"Attribute Key Constants" section for a description of currently defined
attributes.result - On return, a CFTypeRef reference to the newly added item(s).
The exact type of the result is based on the values supplied
in attributes, as discussed below. Pass NULL if this result is not
required.public static int SecItemUpdate(CFDictionaryRef query, CFDictionaryRef attributesToUpdate)
Modify zero or more items which match a search query.
Attributes defining a search are specified by adding key/value pairs to the query dictionary.
query - A dictionary containing an item class specification and
optional attributes for controlling the search. See the "Attribute
Constants" and "Search Constants" sections for a description of
currently defined search attributes.attributesToUpdate - A dictionary containing one or more attributes
whose values should be set to the ones specified. Only real keychain
attributes are permitted in this dictionary (no "meta" attributes are
allowed.) See the "Attribute Key Constants" section for a description of
currently defined value attributes.public static int SecItemDelete(CFDictionaryRef query)
Delete zero or more items which match a search query.
Attributes defining a search are specified by adding key/value pairs to the query dictionary.
By default, this function deletes all items matching the specified query. You can change this behavior by specifying one of the follow keys:
* To delete an item identified by a transient reference, on iOS, specify kSecValueRef with a item reference. On OS X, give a kSecMatchItemList containing an item reference. * To delete an item identified by a persistent reference, on iOS, specify kSecValuePersistentRef with a persistent reference returned by using the kSecReturnPersistentRef key to SecItemCopyMatching or SecItemAdd. on OSX, use kSecMatchItemList with a persistent reference returned by using the kSecReturnPersistentRef key with SecItemCopyMatching or SecItemAdd. * To delete multiple items specify kSecMatchItemList with an array of references. * If more than one of these result keys is specified, the behavior is undefined.
query - A dictionary containing an item class specification and
optional attributes for controlling the search. See the "Attribute
Constants" and "Search Constants" sections for a description of
currently defined search attributes.public static long SecKeyGetTypeID()
Returns the type identifier of SecKey instances.
public static int SecKeyGeneratePair(CFDictionaryRef parameters, org.moe.natj.general.ptr.Ptr<SecKeyRef> publicKey, org.moe.natj.general.ptr.Ptr<SecKeyRef> privateKey)
Generate a private/public keypair.
In order to generate a keypair the parameters dictionary must at least contain the following keys:
* kSecAttrKeyType with a value of kSecAttrKeyTypeRSA or any other kSecAttrKeyType defined in SecItem.h * kSecAttrKeySizeInBits with a value being a CFNumberRef containing the requested key size in bits. Example sizes for RSA keys are: 512, 768, 1024, 2048.
The values below may be set either in the top-level dictionary or in a dictionary that is the value of the kSecPrivateKeyAttrs or kSecPublicKeyAttrs key in the top-level dictionary. Setting these attributes explicitly will override the defaults below. See SecItem.h for detailed information on these attributes including the types of the values.
* kSecAttrLabel default NULL * kSecUseKeychain default NULL, which specifies the default keychain * kSecAttrIsPermanent default false if this key is present and has a Boolean value of true, the key or key pair will be added to the keychain. * kSecAttrTokenID default NULL The CFStringRef ID of the token to generate the key or keypair on. This attribute can contain CFStringRef and can be present only in the top-level parameters dictionary. * kSecAttrApplicationTag default NULL * kSecAttrEffectiveKeySize default NULL same as kSecAttrKeySizeInBits * kSecAttrCanEncrypt default false for private keys, true for public keys * kSecAttrCanDecrypt default true for private keys, false for public keys * kSecAttrCanDerive default true * kSecAttrCanSign default true for private keys, false for public keys * kSecAttrCanVerify default false for private keys, true for public keys * kSecAttrCanWrap default false for private keys, true for public keys * kSecAttrCanUnwrap default true for private keys, false for public keys
NOTE: The function always saves keys in the keychain on macOS and as such attribute kSecAttrIsPermanent is ignored. The function respects attribute kSecAttrIsPermanent on iOS, tvOS and watchOS. It is recommended to use SecKeyCreateRandomKey() which respects kSecAttrIsPermanent on all platforms.
parameters - A dictionary containing one or more key-value pairs.
See the discussion sections below for a complete overview of options.publicKey - On return, a SecKeyRef reference to the public key.privateKey - On return, a SecKeyRef reference to the private key.public static int SecKeyRawSign(SecKeyRef key, int padding, java.lang.String dataToSign, long dataToSignLen, org.moe.natj.general.ptr.BytePtr sig, org.moe.natj.general.ptr.NUIntPtr sigLen)
Given a private key and data to sign, generate a digital signature.
If the padding argument is kSecPaddingPKCS1, PKCS1 padding will be performed prior to signing. If this argument is kSecPaddingNone, the incoming data will be signed "as is".
When PKCS1 padding is performed, the maximum length of data that can be signed is the value returned by SecKeyGetBlockSize() - 11.
NOTE: The behavior this function with kSecPaddingNone is undefined if the first byte of dataToSign is zero; there is no way to verify leading zeroes as they are discarded during the calculation.
If you want to generate a proper PKCS1 style signature with DER encoding of the digest type - and the dataToSign is a SHA1 digest - use kSecPaddingPKCS1SHA1.
key - Private key with which to sign.padding - See Padding Types above, typically kSecPaddingPKCS1SHA1.dataToSign - The data to be signed, typically the digest of the
actual data.dataToSignLen - Length of dataToSign in bytes.sig - Pointer to buffer in which the signature will be returned.sigLen - IN/OUT maximum length of sig buffer on input, actualy
length of sig on output.public static int SecKeyRawVerify(SecKeyRef key, int padding, java.lang.String signedData, long signedDataLen, java.lang.String sig, long sigLen)
Given a public key, data which has been signed, and a signature, verify the signature.
If the padding argument is kSecPaddingPKCS1, PKCS1 padding will be checked during verification. If this argument is kSecPaddingNone, the incoming data will be compared directly to sig.
If you are verifying a proper PKCS1-style signature, with DER encoding of the digest type - and the signedData is a SHA1 digest - use kSecPaddingPKCS1SHA1.
key - Public key with which to verify the signature.padding - See Padding Types above, typically kSecPaddingPKCS1SHA1.signedData - The data over which sig is being verified, typically
the digest of the actual data.signedDataLen - Length of signedData in bytes.sig - Pointer to the signature to verify.sigLen - Length of sig in bytes.public static int SecKeyEncrypt(SecKeyRef key, int padding, java.lang.String plainText, long plainTextLen, org.moe.natj.general.ptr.BytePtr cipherText, org.moe.natj.general.ptr.NUIntPtr cipherTextLen)
Encrypt a block of plaintext.
If the padding argument is kSecPaddingPKCS1 or kSecPaddingOAEP, PKCS1 (respectively kSecPaddingOAEP) padding will be performed prior to encryption. If this argument is kSecPaddingNone, the incoming data will be encrypted "as is". kSecPaddingOAEP is the recommended value. Other value are not recommended for security reason (Padding attack or malleability).
When PKCS1 padding is performed, the maximum length of data that can be encrypted is the value returned by SecKeyGetBlockSize() - 11.
When memory usage is a critical issue, note that the input buffer (plainText) can be the same as the output buffer (cipherText).
key - Public key with which to encrypt the data.padding - See Padding Types above, typically kSecPaddingPKCS1.plainText - The data to encrypt.plainTextLen - Length of plainText in bytes, this must be less
or equal to the value returned by SecKeyGetBlockSize().cipherText - Pointer to the output buffer.cipherTextLen - On input, specifies how much space is available at
cipherText; on return, it is the actual number of cipherText bytes written.public static int SecKeyDecrypt(SecKeyRef key, int padding, java.lang.String cipherText, long cipherTextLen, org.moe.natj.general.ptr.BytePtr plainText, org.moe.natj.general.ptr.NUIntPtr plainTextLen)
Decrypt a block of ciphertext.
If the padding argument is kSecPaddingPKCS1 or kSecPaddingOAEP, the corresponding padding will be removed after decryption. If this argument is kSecPaddingNone, the decrypted data will be returned "as is".
When memory usage is a critical issue, note that the input buffer (plainText) can be the same as the output buffer (cipherText).
key - Private key with which to decrypt the data.padding - See Padding Types above, typically kSecPaddingPKCS1.cipherText - The data to decrypt.cipherTextLen - Length of cipherText in bytes, this must be less
or equal to the value returned by SecKeyGetBlockSize().plainText - Pointer to the output buffer.plainTextLen - On input, specifies how much space is available at
plainText; on return, it is the actual number of plainText bytes written.public static long SecKeyGetBlockSize(SecKeyRef key)
Returns block length of the key in bytes.
If for example key is an RSA key the value returned by this function is the size of the modulus.
key - The key for which the block length is requested.public static SecKeyRef SecKeyCreateRandomKey(CFDictionaryRef parameters, org.moe.natj.general.ptr.Ptr<CFErrorRef> error)
Generates a new public/private key pair.
In order to generate a keypair the parameters dictionary must at least contain the following keys:
* kSecAttrKeyType with a value being kSecAttrKeyTypeRSA or any other kSecAttrKeyType defined in SecItem.h * kSecAttrKeySizeInBits with a value being a CFNumberRef or CFStringRef containing the requested key size in bits. Example sizes for RSA keys are: 512, 768, 1024, 2048.
The values below may be set either in the top-level dictionary or in a dictionary that is the value of the kSecPrivateKeyAttrs or kSecPublicKeyAttrs key in the top-level dictionary. Setting these attributes explicitly will override the defaults below. See SecItem.h for detailed information on these attributes including the types of the values.
* kSecAttrLabel default NULL * kSecAttrIsPermanent if this key is present and has a Boolean value of true, the key or key pair will be added to the default keychain. * kSecAttrTokenID if this key should be generated on specified token. This attribute can contain CFStringRef and can be present only in the top-level parameters dictionary. * kSecAttrApplicationTag default NULL * kSecAttrEffectiveKeySize default NULL same as kSecAttrKeySizeInBits * kSecAttrCanEncrypt default false for private keys, true for public keys * kSecAttrCanDecrypt default true for private keys, false for public keys * kSecAttrCanDerive default true * kSecAttrCanSign default true for private keys, false for public keys * kSecAttrCanVerify default false for private keys, true for public keys * kSecAttrCanWrap default false for private keys, true for public keys * kSecAttrCanUnwrap default true for private keys, false for public keys
parameters - A dictionary containing one or more key-value pairs.
See the discussion sections below for a complete overview of options.error - On error, will be populated with an error object describing the failure.
See "Security Error Codes" (SecBase.h).public static SecKeyRef SecKeyCreateWithData(CFDataRef keyData, CFDictionaryRef attributes, org.moe.natj.general.ptr.Ptr<CFErrorRef> error)
Create a SecKey from a well-defined external representation.
This function does not add keys to any keychain, but the SecKey object it returns can be added to keychain using the SecItemAdd function. The requested data format depend on the type of key (kSecAttrKeyType) being created: * kSecAttrKeyTypeRSA PKCS#1 format, public key can be also in x509 public key format * kSecAttrKeyTypeECSECPrimeRandom ANSI X9.63 format (04 || X || Y [ || K])
keyData - CFData representing the key. The format of the data depends on the type of key being created.attributes - Dictionary containing attributes describing the key to be imported. The keys in this dictionary
are kSecAttr* constants from SecItem.h. Mandatory attributes are:
* kSecAttrKeyType
* kSecAttrKeyClasserror - On error, will be populated with an error object describing the failure.
See "Security Error Codes" (SecBase.h).public static CFDataRef SecKeyCopyExternalRepresentation(SecKeyRef key, org.moe.natj.general.ptr.Ptr<CFErrorRef> error)
Create an external representation for the given key suitable for the key's type.
This function may fail if the key is not exportable (e.g., bound to a smart card or Secure Enclave). The format in which the key will be exported depends on the type of key: * kSecAttrKeyTypeRSA PKCS#1 format * kSecAttrKeyTypeECSECPrimeRandom ANSI X9.63 format (04 || X || Y [ || K])
key - The key to be exported.error - On error, will be populated with an error object describing the failure.
See "Security Error Codes" (SecBase.h).public static CFDictionaryRef SecKeyCopyAttributes(SecKeyRef key)
Retrieve keychain attributes of a key.
The attributes provided by this function are: * kSecAttrCanEncrypt * kSecAttrCanDecrypt * kSecAttrCanDerive * kSecAttrCanSign * kSecAttrCanVerify * kSecAttrKeyClass * kSecAttrKeyType * kSecAttrKeySizeInBits * kSecAttrTokenID * kSecAttrApplicationLabel The set of values is not fixed. Future versions may return more values in this dictionary.
key - The key whose attributes are to be retrieved.public static SecKeyRef SecKeyCopyPublicKey(SecKeyRef key)
Retrieve the public key from a key pair or private key.
Fails if key does not contain a public key or no public key can be computed from it.
key - The key from which to retrieve a public key.public static CFDataRef SecKeyCreateSignature(SecKeyRef key, CFStringRef algorithm, CFDataRef dataToSign, org.moe.natj.general.ptr.Ptr<CFErrorRef> error)
Given a private key and data to sign, generate a digital signature.
Computes digital signature using specified key over input data. The operation algorithm further defines the exact format of input data, operation to be performed and output signature.
key - Private key with which to sign.algorithm - One of SecKeyAlgorithm constants suitable to generate signature with this key.dataToSign - The data to be signed, typically the digest of the actual data.error - On error, will be populated with an error object describing the failure.
See "Security Error Codes" (SecBase.h).public static byte SecKeyVerifySignature(SecKeyRef key, CFStringRef algorithm, CFDataRef signedData, CFDataRef signature, org.moe.natj.general.ptr.Ptr<CFErrorRef> error)
Given a public key, data which has been signed, and a signature, verify the signature.
Verifies digital signature operation using specified key and signed data. The operation algorithm further defines the exact format of input data, signature and operation to be performed.
key - Public key with which to verify the signature.algorithm - One of SecKeyAlgorithm constants suitable to verify signature with this key.signedData - The data over which sig is being verified, typically the digest of the actual data.signature - The signature to verify.error - On error, will be populated with an error object describing the failure.
See "Security Error Codes" (SecBase.h).public static CFDataRef SecKeyCreateEncryptedData(SecKeyRef key, CFStringRef algorithm, CFDataRef plaintext, org.moe.natj.general.ptr.Ptr<CFErrorRef> error)
Encrypt a block of plaintext.
Encrypts plaintext data using specified key. The exact type of the operation including the format of input and output data is specified by encryption algorithm.
key - Public key with which to encrypt the data.algorithm - One of SecKeyAlgorithm constants suitable to perform encryption with this key.plaintext - The data to encrypt. The length and format of the data must conform to chosen algorithm,
typically be less or equal to the value returned by SecKeyGetBlockSize().error - On error, will be populated with an error object describing the failure.
See "Security Error Codes" (SecBase.h).public static CFDataRef SecKeyCreateDecryptedData(SecKeyRef key, CFStringRef algorithm, CFDataRef ciphertext, org.moe.natj.general.ptr.Ptr<CFErrorRef> error)
Decrypt a block of ciphertext.
Decrypts ciphertext data using specified key. The exact type of the operation including the format of input and output data is specified by decryption algorithm.
key - Private key with which to decrypt the data.algorithm - One of SecKeyAlgorithm constants suitable to perform decryption with this key.ciphertext - The data to decrypt. The length and format of the data must conform to chosen algorithm,
typically be less or equal to the value returned by SecKeyGetBlockSize().error - On error, will be populated with an error object describing the failure.
See "Security Error Codes" (SecBase.h).public static CFDataRef SecKeyCopyKeyExchangeResult(SecKeyRef privateKey, CFStringRef algorithm, SecKeyRef publicKey, CFDictionaryRef parameters, org.moe.natj.general.ptr.Ptr<CFErrorRef> error)
Perform Diffie-Hellman style of key exchange operation, optionally with additional key-derivation steps.
algorithm - One of SecKeyAlgorithm constants suitable to perform this operation.publicKey - Remote party's public key.parameters - Dictionary with parameters, see SecKeyKeyExchangeParameter constants. Used algorithm
determines the set of required and optional parameters to be used.error - Pointer to an error object on failure.
See "Security Error Codes" (SecBase.h).public static byte SecKeyIsAlgorithmSupported(SecKeyRef key, long operation, CFStringRef algorithm)
Checks whether key supports specified algorithm for specified operation.
key - Key to queryoperation - Operation type for which the key is queriedalgorithm - Algorithm which is queriedpublic static long SecPolicyGetTypeID()
Returns the type identifier of SecPolicy instances.
public static CFDictionaryRef SecPolicyCopyProperties(SecPolicyRef policyRef)
Returns a dictionary of this policy's properties.
This function returns the properties for a policy, as set by the policy's construction function or by a prior call to SecPolicySetProperties.
policyRef - A policy reference.public static SecPolicyRef SecPolicyCreateBasicX509()
Returns a policy object for the default X.509 policy.
public static SecPolicyRef SecPolicyCreateSSL(byte server, CFStringRef hostname)
Returns a policy object for evaluating SSL certificate chains.
server - Passing true for this parameter creates a policy for SSL
server certificates.hostname - (Optional) If present, the policy will require the specified
hostname to match the hostname in the leaf certificate.public static SecPolicyRef SecPolicyCreateRevocation(long revocationFlags)
Returns a policy object for checking revocation of certificates.
Use this function to create a revocation policy with behavior specified by revocationFlags. See the "Revocation Policy Constants" section for a description of these flags. Note: it is usually not necessary to create a revocation policy yourself unless you wish to override default system behavior (e.g. to force a particular method, or to disable revocation checking entirely.)
revocationFlags - Flags to specify revocation checking options.public static SecPolicyRef SecPolicyCreateWithProperties(org.moe.natj.general.ptr.ConstVoidPtr policyIdentifier, CFDictionaryRef properties)
Returns a policy object based on an object identifier for the policy type. See the "Policy Constants" section for a list of defined policy object identifiers.
policyIdentifier - The identifier for the desired policy type.properties - (Optional) A properties dictionary. See "Policy Value
Constants" for a list of currently defined property keys.public static int SecRandomCopyBytes(SecRandomRef rnd, long count, org.moe.natj.general.ptr.VoidPtr bytes)
Return count random bytes in *bytes, allocated by the caller. It is critical to check the return value for error.
If @p rnd is unrecognized or unsupported, @p kSecRandomDefault is used.
rnd - Only @p kSecRandomDefault is supported.count - The number of bytes to generate.bytes - A buffer to fill with random output.public static void SecAddSharedWebCredential(CFStringRef fqdn, CFStringRef account, CFStringRef password, Security.Block_SecAddSharedWebCredential completionHandler)
Asynchronously store (or update) a shared password for a website.
This function adds a shared password item which will be accessible by Safari and applications that have the specified fully-qualified domain name in their 'com.apple.developer.associated-domains' entitlement. If a shared password item already exists for the specified website and account, it will be updated with the provided password. To remove a password, pass NULL for the password parameter.
Note: since a request involving shared web credentials may potentially require user interaction or other verification to be approved, this function is dispatched asynchronously; your code provides a completion handler that will be called once the results (if any) are available.
fqdn - The fully qualified domain name of the website requiring the password.account - The account name associated with this password.password - The password to be stored. Pass NULL to remove a shared password if it exists.completionHandler - A block which will be invoked when the function has completed. If the shared password was successfully added (or removed), the CFErrorRef parameter passed to the block will be NULL. If the error parameter is non-NULL, an error occurred and the error reference will hold the result. Note: the error reference will be automatically released after this handler is called, though you may optionally retain it for as long as needed.public static void SecRequestSharedWebCredential(CFStringRef fqdn, CFStringRef account, Security.Block_SecRequestSharedWebCredential completionHandler)
Asynchronously obtain one or more shared passwords for a website.
This function requests one or more shared passwords for a given website, depending on whether the optional account parameter is supplied. To obtain results, the website specified in the fqdn parameter must be one which matches an entry in the calling application's 'com.apple.developer.associated-domains' entitlement.
If matching shared password items are found, the credentials provided to the completionHandler will be a CFArrayRef containing CFDictionaryRef entries. Each dictionary entry will contain the following pairs (see Security/SecItem.h): key: kSecAttrServer value: CFStringRef (the website) key: kSecAttrAccount value: CFStringRef (the account) key: kSecSharedPassword value: CFStringRef (the password)
If the found item specifies a non-standard port number (i.e. other than 443 for https), the following key may also be present: key: kSecAttrPort value: CFNumberRef (the port number)
Note: since a request involving shared web credentials may potentially require user interaction or other verification to be approved, this function is dispatched asynchronously; your code provides a completion handler that will be called once the results (if any) are available.
fqdn - (Optional) Fully qualified domain name of the website for which passwords are being requested. If NULL is passed in this argument, the domain name(s) listed in the calling application's 'com.apple.developer.associated-domains' entitlement are searched implicitly.account - (Optional) Account name for which passwords are being requested. The account may be NULL to request all shared credentials which are available for the site, allowing the caller to discover an existing account.completionHandler - A block which will be called to deliver the requested credentials. If no matching items were found, the credentials array will be empty, and the CFErrorRef parameter will provide the error result. Note: the credentials and error references will be automatically released after this handler is called, though you may optionally retain either for as long as needed.public static CFStringRef SecCreateSharedWebCredentialPassword()
Returns a randomly generated password.
public static long SecTrustGetTypeID()
Returns the type identifier of SecTrust instances.
public static int SecTrustCreateWithCertificates(org.moe.natj.general.ptr.ConstVoidPtr certificates,
org.moe.natj.general.ptr.ConstVoidPtr policies,
org.moe.natj.general.ptr.Ptr<SecTrustRef> trust)
Creates a trust object based on the given certificates and policies.
If multiple policies are passed in, all policies must verify for the chain to be considered valid.
certificates - The group of certificates to verify. This can either
be a CFArrayRef of SecCertificateRef objects or a single SecCertificateRefpolicies - An array of one or more policies. You may pass a
SecPolicyRef to represent a single policy.trust - On return, a pointer to the trust management reference.public static int SecTrustSetPolicies(SecTrustRef trust, org.moe.natj.general.ptr.ConstVoidPtr policies)
Set the policies for which trust should be verified.
This function will invalidate the existing trust result, requiring a fresh evaluation for the newly-set policies.
trust - A trust reference.policies - An array of one or more policies. You may pass a
SecPolicyRef to represent a single policy.public static int SecTrustCopyPolicies(SecTrustRef trust, org.moe.natj.general.ptr.Ptr<CFArrayRef> policies)
Returns an array of policies used for this evaluation.
trust - A reference to a trust object.policies - On return, an array of policies used by this trust.
Call the CFRelease function to release this reference.public static int SecTrustSetNetworkFetchAllowed(SecTrustRef trust, byte allowFetch)
Specifies whether a trust evaluation is permitted to fetch missing intermediate certificates from the network.
By default, network fetch of missing certificates is enabled if the trust evaluation includes the SSL policy, otherwise it is disabled.
trust - A trust reference.allowFetch - If true, and a certificate's issuer is not present in the
trust reference but its network location is known, the evaluation is permitted
to attempt to download it automatically. Pass false to disable network fetch
for this trust evaluation.public static int SecTrustGetNetworkFetchAllowed(SecTrustRef trust, org.moe.natj.general.ptr.BytePtr allowFetch)
Returns whether a trust evaluation is permitted to fetch missing intermediate certificates from the network.
By default, network fetch of missing certificates is enabled if the trust evaluation includes the SSL policy, otherwise it is disabled.
trust - A trust reference.allowFetch - On return, the boolean pointed to by this parameter is
set to true if the evaluation is permitted to download missing certificates.public static int SecTrustSetAnchorCertificates(SecTrustRef trust, CFArrayRef anchorCertificates)
Sets the anchor certificates for a given trust.
Calling this function without also calling SecTrustSetAnchorCertificatesOnly() will disable trusting any anchors other than the ones in anchorCertificates.
trust - A reference to a trust object.anchorCertificates - An array of anchor certificates.
Pass NULL to restore the default set of anchor certificates.public static int SecTrustSetAnchorCertificatesOnly(SecTrustRef trust, byte anchorCertificatesOnly)
Reenables trusting anchor certificates in addition to those passed in via the SecTrustSetAnchorCertificates API.
trust - A reference to a trust object.anchorCertificatesOnly - If true, disables trusting any anchors other
than the ones passed in via SecTrustSetAnchorCertificates(). If false,
the built in anchor certificates are also trusted.public static int SecTrustCopyCustomAnchorCertificates(SecTrustRef trust, org.moe.natj.general.ptr.Ptr<CFArrayRef> anchors)
Returns an array of custom anchor certificates used by a given trust, as set by a prior call to SecTrustSetAnchorCertificates, or NULL if no custom anchors have been specified.
trust - A reference to a trust object.anchors - On return, an array of custom anchor certificates (roots)
used by this trust, or NULL if no custom anchors have been specified. Call
the CFRelease function to release this reference.public static int SecTrustSetVerifyDate(SecTrustRef trust, CFDateRef verifyDate)
Set the date for which the trust should be verified.
This function lets you evaluate certificate validity for a given date (for example, to determine if a signature was valid on the date it was signed, even if the certificate has since expired.) If this function is not called, the time at which SecTrustEvaluate() is called is used implicitly as the verification time.
trust - A reference to a trust object.verifyDate - The date for which to verify trust.public static double SecTrustGetVerifyTime(SecTrustRef trust)
Returns the verify time.
This function retrieves the verification time for the given trust reference, as set by a prior call to SecTrustSetVerifyDate(). If the verification time has not been set, this function returns a value of 0, indicating that the current date/time is implicitly used for verification.
trust - A reference to the trust object being verified.public static int SecTrustEvaluate(SecTrustRef trust, org.moe.natj.general.ptr.IntPtr result)
Evaluates a trust reference synchronously.
This function will completely evaluate trust before returning, possibly including network access to fetch intermediate certificates or to perform revocation checking. Since this function can block during those operations, you should call it from within a function that is placed on a dispatch queue, or in a separate thread from your application's main run loop. Alternatively, you can use the SecTrustEvaluateAsync function.
trust - A reference to the trust object to evaluate.result - A pointer to a result type.public static int SecTrustEvaluateAsync(SecTrustRef trust, NSObject queue, Security.Block_SecTrustEvaluateAsync result)
Evaluates a trust reference asynchronously.
trust - A reference to the trust object to evaluate.queue - A dispatch queue on which the result callback should be
executed. Pass NULL to use the current dispatch queue.result - A SecTrustCallback block which will be executed when the
trust evaluation is complete.public static int SecTrustGetTrustResult(SecTrustRef trust, org.moe.natj.general.ptr.IntPtr result)
This function replaces SecTrustGetResult for the purpose of obtaining the current evaluation result of a given trust reference.
trust - A reference to a trust object.result - A pointer to the result from the most recent call to
SecTrustEvaluate for this trust reference. If SecTrustEvaluate has not been
called or trust parameters have changed, the result is kSecTrustResultInvalid.public static SecKeyRef SecTrustCopyPublicKey(SecTrustRef trust)
Return the public key for a leaf certificate after it has been evaluated.
trust - A reference to the trust object which has been evaluated.public static long SecTrustGetCertificateCount(SecTrustRef trust)
Returns the number of certificates in an evaluated certificate chain.
Important: if the trust reference has not yet been evaluated, this function will evaluate it first before returning. If speed is critical, you may want to call SecTrustGetTrustResult first to make sure that a result other than kSecTrustResultInvalid is present for the trust object.
trust - A reference to a trust object.public static SecCertificateRef SecTrustGetCertificateAtIndex(SecTrustRef trust, long ix)
Returns a certificate from the trust chain.
This API is fundamentally not thread-safe -- other threads using the same trust object may trigger trust evaluations that release the returned certificate or change the certificate chain as a thread is iterating through the certificate chain. The replacement function SecTrustCopyCertificateChain provides thread-safe results.
trust - Reference to a trust object.ix - The index of the requested certificate. Indices run from 0
(leaf) to the anchor (or last certificate found if no anchor was found).
The leaf cert (index 0) is always present regardless of whether the trust
reference has been evaluated or not.public static CFDataRef SecTrustCopyExceptions(SecTrustRef trust)
Returns an opaque cookie which will allow future evaluations of the current certificate to succeed.
Normally this API should only be called once the errors have been presented to the user and the user decided to trust the current certificate chain regardless of the errors being presented, for the current application/server/protocol combination.
trust - A reference to an evaluated trust object.public static boolean SecTrustSetExceptions(SecTrustRef trust, CFDataRef exceptions)
Set a trust cookie to be used for evaluating this certificate chain.
Clients of this interface will need to establish the context of this exception to later decide when this exception cookie is to be used. Examples of this context would be the server we are connecting to, the ssid of the wireless network for which this cert is needed, the account for which this cert should be considered valid, and so on.
trust - A reference to a trust object.exceptions - An exceptions cookie as returned by a call to
SecTrustCopyExceptions() in the past. You may pass NULL to clear any
exceptions which have been previously set on this trust reference.public static CFArrayRef SecTrustCopyProperties(SecTrustRef trust)
Return a property array for this trust evaluation.
On macOS, this function returns an ordered array of CFDictionaryRef instances for each certificate in the chain. Indices run from 0 (leaf) to the anchor (or last certificate found if no anchor was found.) On other platforms, this function returns an unordered array of CFDictionary instances. See the "Trust Property Constants" section for a list of currently defined keys. The error information conveyed via this interface is also conveyed via the returned error of SecTrustEvaluateWithError.
trust - A reference to a trust object. If the trust has not been
evaluated, the returned property array will be empty.public static CFDictionaryRef SecTrustCopyResult(SecTrustRef trust)
Returns a dictionary containing information about the evaluated certificate chain for use by clients.
Returns a dictionary for the overall trust evaluation. See the "Trust Result Constants" section for a list of currently defined keys.
trust - A reference to a trust object.public static int SecTrustSetOCSPResponse(SecTrustRef trust, org.moe.natj.general.ptr.ConstVoidPtr responseData)
Attach OCSPResponse data to a trust object.
Allows the caller to provide OCSPResponse data (which may be obtained during a TLS/SSL handshake, per RFC 3546) as input to a trust evaluation. If this data is available, it can obviate the need to contact an OCSP server for current revocation information.
trust - A reference to a trust object.responseData - This may be either a CFData object containing a single
DER-encoded OCSPResponse (per RFC 2560), or a CFArray of these.public static long SSLContextGetTypeID()
Return the CFTypeID for SSLContext objects.
public static SSLContextRef SSLCreateContext(CFAllocatorRef alloc, int protocolSide, int connectionType)
Create a new instance of an SSLContextRef using the specified allocator.
alloc - Allocator to use for memory.protooclSide - Client or server indication.connectionType - Type of connection.public static int SSLGetSessionState(SSLContextRef context, org.moe.natj.general.ptr.IntPtr state)
Determine the state of an SSL/DTLS session.
context - A valid SSLContextRef.state - Output pointer to store the SSLSessionState.public static int SSLSetSessionOption(SSLContextRef context, int option, byte value)
Set options for an SSL session. Must be called prior to SSLHandshake(); subsequently cannot be called while session is active.
context - A valid SSLContextRef.option - An option enumeration value.value - Value of the SSLSessionOption.public static int SSLGetSessionOption(SSLContextRef context, int option, org.moe.natj.general.ptr.BytePtr value)
Determine current value for the specified option in a given SSL session.
context - A valid SSLContextRef.option - An option enumeration value.value - Pointer to a Boolean where the SSLSessionOption value is stored.public static int SSLSetIOFuncs(SSLContextRef context, Security.Function_SSLSetIOFuncs_1 readFunc, Security.Function_SSLSetIOFuncs_2 writeFunc)
Specify functions which do the network I/O. Must be called prior to SSLHandshake(); subsequently cannot be called while a session is active.
context - A valid SSLContextRef.readFunc - Pointer to a SSLReadFunc.writeFunc - Pointer to a SSLWriteFunc.public static int SSLSetSessionConfig(SSLContextRef context, CFStringRef config)
context - A valid SSLContextRef.config - String name of constant TLS handshake configuration, e.g., kSSLSessionConfig_standard.public static int SSLSetProtocolVersionMin(SSLContextRef context, int minVersion)
Set the minimum SSL protocol version allowed. Optional. The default is the lower supported protocol. [@note] This can only be called when no session is active.
For TLS contexts, legal values for minVersion are : kSSLProtocol3 kTLSProtocol1 kTLSProtocol11 kTLSProtocol12
For DTLS contexts, legal values for minVersion are : kDTLSProtocol1
context - A valid SSLContextRef.minVersion - Minimum TLS protocol version.public static int SSLGetProtocolVersionMin(SSLContextRef context, org.moe.natj.general.ptr.IntPtr minVersion)
Get minimum protocol version allowed
context - A valid SSLContextRef.minVersion - Pointer to SSLProtocol value where the minimum protocol version is stored.public static int SSLSetProtocolVersionMax(SSLContextRef context, int maxVersion)
Set the maximum SSL protocol version allowed. Optional. The default is the highest supported protocol. [@note] This can only be called when no session is active.
For TLS contexts, legal values for maxVersion are : kSSLProtocol3 kTLSProtocol1 kTLSProtocol11 kTLSProtocol12
For DTLS contexts, legal values for maxVersion are : kDTLSProtocol1
context - A valid SSLContextRef.maxVersion - Maximum TLS protocol version.public static int SSLGetProtocolVersionMax(SSLContextRef context, org.moe.natj.general.ptr.IntPtr maxVersion)
Get maximum protocol version allowed
context - A valid SSLContextRef.maxVersion - Pointer to SSLProtocol value where the maximum protocol version is stored.public static int SSLSetCertificate(SSLContextRef context, CFArrayRef certRefs)
Specify this connection's certificate(s).
This is mandatory for server connections,and optional for clients. Specifying a certificate for a client enables SSL client-side authentication. The end-entity cert is in certRefs[0]. Specifying a root cert is optional; if it's not specified, the root cert which verifies the cert chain specified here must be present in the system-wide set of trusted anchor certs.
The certRefs argument is a CFArray containing SecCertificateRefs, except for certRefs[0], which is a SecIdentityRef.
Must be called prior to SSLHandshake(), or immediately after SSLHandshake has returned errSSLClientCertRequested (i.e. before the handshake is resumed by calling SSLHandshake again.)
SecureTransport assumes the following:
-- The certRef references remain valid for the lifetime of the session. -- The certificate specified in certRefs[0] is capable of signing. -- The required capabilities of the certRef[0], and of the optional cert specified in SSLSetEncryptionCertificate (see below), are highly dependent on the application. For example, to work as a server with Netscape clients, the cert specified here must be capable of both signing and encrypting.
context - A valid SSLContextRef.certRefs - An array of SecCertificateRef instances.public static int SSLSetConnection(SSLContextRef context, org.moe.natj.general.ptr.ConstVoidPtr connection)
Specify I/O connection - a socket, endpoint, etc., which is managed by caller.
On the client side, it's assumed that communication has been established with the desired server on this connection. On the server side, it's assumed that an incoming client request has been established.
Must be called prior to SSLHandshake(); subsequently can only be called when no session is active.
context - A valid SSLContextRef.connection - A SSLConnectionRef.public static int SSLGetConnection(SSLContextRef context, org.moe.natj.general.ptr.Ptr<org.moe.natj.general.ptr.ConstVoidPtr> connection)
Retrieve the I/O connection managed managed by the caller.
context - A valid SSLContextRef.connection - A SSLConnectionRef pointer.public static int SSLSetPeerDomainName(SSLContextRef context, java.lang.String peerName, long peerNameLen)
Specify the fully qualified doman name of the peer, e.g., "store.apple.com."
Optional; used to verify the common name field in peer's certificate. Name is in the form of a C string; NULL termination optional, i.e., peerName[peerNameLen+1] may or may not have a NULL. In any case peerNameLen is the number of bytes of the peer domain name.
context - A valid SSLContextRef.peerName - A C string carrying the peer domain name.peerNameLen - Length of the peer domain name string.public static int SSLGetPeerDomainNameLength(SSLContextRef context, org.moe.natj.general.ptr.NUIntPtr peerNameLen)
Determine the buffer size needed for SSLGetPeerDomainName().
context - A valid SSLContextRef.peerNameLen - Pointer to where the length of the peer domain name string is storedpublic static int SSLGetPeerDomainName(SSLContextRef context, org.moe.natj.general.ptr.BytePtr peerName, org.moe.natj.general.ptr.NUIntPtr peerNameLen)
Obtain the value specified in SSLSetPeerDomainName().
context - A valid SSLContextRef.peerName - Pointer to where the peer domain name is stored.peerNameLen - Pointer to where the length of the peer domain name string is stored,
up to the length specified by peerNameLen (on input).public static int SSLCopyRequestedPeerName(SSLContextRef context, org.moe.natj.general.ptr.BytePtr peerName, org.moe.natj.general.ptr.NUIntPtr peerNameLen)
Determine the buffer size needed for SSLCopyRequestedPeerNameLength().
context - A valid SSLContextRef.peerName - Pointer to where the requested peer domain name is stored.peerNameLen - Pointer to where the length of the requested peer domain name string
is stored, up to the length specified by peerNameLen (on input).public static int SSLCopyRequestedPeerNameLength(SSLContextRef ctx, org.moe.natj.general.ptr.NUIntPtr peerNameLen)
[Server Only] obtain the hostname specified by the client in the ServerName extension (SNI)
context - A valid SSLContextRef.peerNameLen - Pointer to where the length of the requested peer domain name string
is stored, up to the length specified by peerNameLen (on input).public static int SSLSetDatagramHelloCookie(SSLContextRef dtlsContext, org.moe.natj.general.ptr.ConstVoidPtr cookie, long cookieLen)
Specify the Datagram TLS Hello Cookie.
This is to be called for server side only and is optional. The default is a zero len cookie. The maximum cookieLen is 32 bytes.
context - A valid SSLContextRef.cookie - Pointer to opaque cookie data.cookieLen - Length of cookie data.public static int SSLSetMaxDatagramRecordSize(SSLContextRef dtlsContext, long maxSize)
Specify the maximum record size, including all DTLS record headers.
This should be set appropriately to avoid fragmentation of Datagrams during handshake, as fragmented datagrams may be dropped by some network. [@note] This is for Datagram TLS only
context - A valid SSLContextRef.maxSize - Maximum size of datagram record(s).public static int SSLGetMaxDatagramRecordSize(SSLContextRef dtlsContext, org.moe.natj.general.ptr.NUIntPtr maxSize)
Get the maximum record size, including all Datagram TLS record headers. [@note] This is for Datagram TLS only
context - A valid SSLContextRef.maxSize - Pointer where maximum size of datagram record(s) is stored.public static int SSLGetNegotiatedProtocolVersion(SSLContextRef context, org.moe.natj.general.ptr.IntPtr protocol)
Obtain the actual negotiated protocol version of the active session, which may be different that the value specified in SSLSetProtocolVersion(). Returns kSSLProtocolUnknown if no SSL session is in progress.
context - A valid SSLContextRef.protocol - Pointer where negotiated SSLProtocol is stored.public static int SSLGetNumberSupportedCiphers(SSLContextRef context, org.moe.natj.general.ptr.NUIntPtr numCiphers)
Determine number and values of all of the SSLCipherSuites we support. Caller allocates output buffer for SSLGetSupportedCiphers() and passes in its size in *numCiphers. If supplied buffer is too small, errSSLBufferOverflow will be returned.
context - A valid SSLContextRef.numCiphers - Pointer where number of supported ciphers is stored.public static int SSLGetSupportedCiphers(SSLContextRef context, org.moe.natj.general.ptr.CharPtr ciphers, org.moe.natj.general.ptr.NUIntPtr numCiphers)
Get the supported ciphers.
context - A valid SSLContextRef.ciphers - Pointer to array of SSLCipherSuite values where supported ciphersuites
are stored. This array size is specified by the input value of numCiphers.numCiphers - Pointer where number of supported ciphers is stored.public static int SSLSetEnabledCiphers(SSLContextRef context, org.moe.natj.general.ptr.ConstCharPtr ciphers, long numCiphers)
Specify a (typically) restricted set of SSLCipherSuites to be enabled by the current SSLContext. Can only be called when no session is active. Default set of enabled SSLCipherSuites is the same as the complete set of supported SSLCipherSuites as obtained by SSLGetSupportedCiphers().
context - A valid SSLContextRef.ciphers - Array of enabled SSLCipherSuite values. This array size is specified
by the input value of numCiphers.numCiphers - Pointer where number of enabled ciphers is stored.public static int SSLGetNumberEnabledCiphers(SSLContextRef context, org.moe.natj.general.ptr.NUIntPtr numCiphers)
Determine number and values of all of the SSLCipherSuites currently enabled. Caller allocates output buffer for SSLGetEnabledCiphers() and passes in its size in *numCiphers. If supplied buffer is too small, errSSLBufferOverflow will be returned.
context - A valid SSLContextRef.numCiphers - Pointer where number of enabled ciphers is stored.public static int SSLGetEnabledCiphers(SSLContextRef context, org.moe.natj.general.ptr.CharPtr ciphers, org.moe.natj.general.ptr.NUIntPtr numCiphers)
Get the set of supported ciphersuites.
context - A valid SSLContextRef.ciphers - Pointer to array of SSLCipherSuite values where enabled ciphersuites
are stored. This array size is specified by the input value of numCiphers.numCiphers - Pointer where number of enabled ciphers is stored.public static int SSLCopyPeerTrust(SSLContextRef context, org.moe.natj.general.ptr.Ptr<SecTrustRef> trust)
Obtain a SecTrustRef representing peer certificates. Valid anytime, subsequent to a handshake attempt. Caller must CFRelease the returned trust reference.
The returned trust reference will have already been evaluated for you, unless one of the following is true: - Your code has disabled automatic certificate verification, by calling SSLSetSessionOption to set kSSLSessionOptionBreakOnServerAuth to true. - Your code has called SSLSetPeerID, and this session has been resumed from an earlier cached session.
In these cases, your code should call SecTrustEvaluate prior to examining the peer certificate chain or trust results (see SecTrust.h).
[@note] If you have not called SSLHandshake at least once prior to calling this function, the returned trust reference will be NULL.
context - A valid SSLContextRef.trust - Pointer to SecTrustRef where peer's SecTrustRef is copied (retained).public static int SSLSetPeerID(SSLContextRef context, org.moe.natj.general.ptr.ConstVoidPtr peerID, long peerIDLen)
Specify some data, opaque to this library, which is sufficient to uniquely identify the peer of the current session. An example would be IP address and port, stored in some caller-private manner. To be optionally called prior to SSLHandshake for the current session. This is mandatory if this session is to be resumable.
SecureTransport allocates its own copy of the incoming peerID. The data provided in *peerID, while opaque to SecureTransport, is used in a byte-for-byte compare to other previous peerID values set by the current application. Matching peerID blobs result in SecureTransport attempting to resume an SSL session with the same parameters as used in the previous session which specified the same peerID bytes.
context - A valid SSLContextRef.peerID - Opaque peer ID.peerIDLen - Length of opaque peer ID.public static int SSLGetPeerID(SSLContextRef context, org.moe.natj.general.ptr.Ptr<org.moe.natj.general.ptr.ConstVoidPtr> peerID, org.moe.natj.general.ptr.NUIntPtr peerIDLen)
Obtain current PeerID. Returns NULL pointer, zero length if SSLSetPeerID has not been called for this context.
context - A valid SSLContextRef.peerID - Pointer to storage for the peer ID.peerIDLen - Pointer to storage for the peer ID length.public static int SSLGetNegotiatedCipher(SSLContextRef context, org.moe.natj.general.ptr.CharPtr cipherSuite)
Obtain the SSLCipherSuite (e.g., SSL_RSA_WITH_DES_CBC_SHA) negotiated for this session. Only valid when a session is active.
context - A valid SSLContextRef.cipherSuite - Pointer to storage for negotiated SSLCipherSuite.@Deprecated public static int SSLSetEncryptionCertificate(SSLContextRef context, CFArrayRef certRefs)
This function is deprecated in OSX 10.11 and iOS 9.0 and has no effect on the TLS handshake since OSX 10.10 and iOS 8.0. Using separate RSA certificates for encryption and signing is no longer supported.
context - A valid SSLContextRef.certRefs - Array of certificates.public static int SSLSetClientSideAuthenticate(SSLContextRef context, int auth)
Specify requirements for client-side authentication.
context - A valid SSLContextRef.auth - A SSLAuthenticate enumeration value.public static int SSLAddDistinguishedName(SSLContextRef context, org.moe.natj.general.ptr.ConstVoidPtr derDN, long derDNLen)
Add a DER-encoded distinguished name to list of acceptable names to be specified in requests for client certificates.
context - A valid SSLContextRef.derDN - A DER-encoded Distinguished Name blob.derDNLen - Length of the Distinguished Name blob.public static int SSLCopyDistinguishedNames(SSLContextRef context, org.moe.natj.general.ptr.Ptr<CFArrayRef> names)
Obtain the list of acceptable distinguished names as provided by a server (if the SSLContextRef is configured as a client), or as specified by SSLSetCertificateAuthorities (if the SSLContextRef is configured as a server).
The returned array contains CFDataRefs, each of which represents one DER-encoded RDN. Caller must CFRelease the returned array.
context - A valid SSLContextRef.names - Pointer to CFArrayRef storage for retained copy of Distinguished Names.public static int SSLGetClientCertificateState(SSLContextRef context, org.moe.natj.general.ptr.IntPtr clientState)
Obtain client certificate exchange status.
Can be called any time. Reflects the *last* client certificate state change; subsequent to a renegotiation attempt by either peer, the state is reset to kSSLClientCertNone.
context - A valid SSLContextRef.clientState - Pointer to SSLClientCertificateState storage.public static int SSLHandshake(SSLContextRef context)
Perform the SSL handshake.
On successful return, session is ready for normal secure application I/O via SSLWrite and SSLRead.
Interesting error returns:
errSSLUnknownRootCert: Peer had a valid cert chain, but the root of the chain is unknown.
errSSLNoRootCert: Peer had a cert chain which did not end in a root.
errSSLCertExpired: Peer's cert chain had one or more expired certs.
errSSLXCertChainInvalid: Peer had an invalid cert chain (i.e., signature verification within the chain failed, or no certs were found).
In all of the above errors, the handshake was aborted; the peer's cert chain is available via SSLCopyPeerTrust or SSLCopyPeerCertificates.
Other interesting result codes:
errSSLPeerAuthCompleted: Peer's cert chain is valid, or was ignored if cert verification was disabled via SSLSetEnableCertVerify. The application may decide to continue with the handshake (by calling SSLHandshake again), or close the connection at this point.
errSSLClientCertRequested: The server has requested a client certificate. The client may choose to examine the server's certificate and distinguished name list, then optionally call SSLSetCertificate prior to resuming the handshake by calling SSLHandshake again.
A return value of errSSLWouldBlock indicates that SSLHandshake has to be called again (and again and again until something else is returned).
context - A valid SSLContextRef.public static int SSLReHandshake(SSLContextRef context)
Server Only: Request renegotation.
This will return an error if the server is already renegotiating, or if the session is closed. After this return without error, the application should call SSLHandshake() and/or SSLRead() as for the original handshake.
context - A valid SSLContextRef.public static int SSLWrite(SSLContextRef context, org.moe.natj.general.ptr.ConstVoidPtr data, long dataLength, org.moe.natj.general.ptr.NUIntPtr processed)
Normal application-level write.
On both of these, a errSSLWouldBlock return and a partially completed transfer - or even zero bytes transferred - are NOT mutually exclusive.
context - A valid SSLContextRef.data - Pointer to data to write.dataLength - Length of data to write.processed - Pointer to storage indicating how much data was written.public static int SSLRead(SSLContextRef context, org.moe.natj.general.ptr.VoidPtr data, long dataLength, org.moe.natj.general.ptr.NUIntPtr processed)
* @abstract Normal application-level write.
Data is mallocd by caller; available size specified in dataLength; actual number of bytes read returned in *processed.
context - A valid SSLContextRef.data - Pointer to storage where data can be read.dataLength - Length of data storage.processed - Pointer to storage indicating how much data was read.public static int SSLGetBufferedReadSize(SSLContextRef context, org.moe.natj.general.ptr.NUIntPtr bufferSize)
Determine how much data the client can be guaranteed to obtain via SSLRead() without blocking or causing any low-level read operations to occur.
context - A valid SSLContextRef.bufferSize - Pointer to store the amount of buffered data to be read.public static int SSLGetDatagramWriteSize(SSLContextRef dtlsContext, org.moe.natj.general.ptr.NUIntPtr bufSize)
Determine how much data the application can be guaranteed to write with SSLWrite() without causing fragmentation. The value is based on the maximum Datagram Record size defined by the application with SSLSetMaxDatagramRecordSize(), minus the DTLS Record header size.
context - A valid SSLContextRef (for DTLS).bufferSize - Pointer to store the amount of data that can be written.public static int SSLClose(SSLContextRef context)
Terminate current SSL session.
context - A valid SSLContextRef.public static CFStringRef kSecImportExportPassphrase()
Predefined key constants used when passing dictionary-based arguments to import/export functions. [@constant] kSecImportExportPassphrase Specifies a passphrase represented by a CFStringRef to be used when exporting to (or importing from) PKCS#12 format. [@constant] kSecImportExportKeychain On OSX, specifies a keychain represented by a SecKeychainRef to be used as the target when importing from PKCS#12 format. [@constant] kSecImportExportAccess On OSX, specifies an access represented by a SecAccessRef for the initial access (ACL) of a key imported from PKCS#12 format.
public static CFStringRef kSecImportItemLabel()
Predefined key constants used to pass back a CFArray with a CFDictionary per item.
[@constant] kSecImportItemLabel a CFStringRef representing the item label. This implementation specific identifier cannot be expected to have any format. [@constant] kSecImportItemKeyID a CFDataRef representing the key id. Often the SHA-1 digest of the public key. [@constant] kSecImportItemIdentity a SecIdentityRef representing the identity. [@constant] kSecImportItemTrust a SecTrustRef set up with all relevant certificates. Not guaranteed to succesfully evaluate. [@constant] kSecImportItemCertChain a CFArrayRef holding all relevant certificates for this item's identity
public static CFStringRef kSecImportItemKeyID()
public static CFStringRef kSecImportItemTrust()
public static CFStringRef kSecImportItemCertChain()
public static CFStringRef kSecImportItemIdentity()
public static CFStringRef kSecClass()
Predefined key constant used to get or set item class values in a dictionary. Its value is one of the constants defined in the Value Constants for kSecClass. [@constant] kSecClass Specifies a dictionary key whose value is the item's class code. You use this key to get or set a value of type CFTypeRef that contains the item class code.
public static CFStringRef kSecClassGenericPassword()
public static CFStringRef kSecClassInternetPassword()
Predefined item class constants used to get or set values in a dictionary. The kSecClass constant is the key and its value is one of the constants defined here. Note: on Mac OS X 10.6, only items of class kSecClassInternetPassword are supported. [@constant] kSecClassInternetPassword Specifies Internet password items. [@constant] kSecClassGenericPassword Specifies generic password items. [@constant] kSecClassCertificate Specifies certificate items. [@constant] kSecClassKey Specifies key items. [@constant] kSecClassIdentity Specifies identity items.
public static CFStringRef kSecClassCertificate()
public static CFStringRef kSecClassKey()
public static CFStringRef kSecClassIdentity()
public static CFStringRef kSecAttrAccessible()
Predefined item attribute keys used to get or set values in a dictionary. Not all attributes apply to each item class. The table below lists the currently defined attributes for each item class:
kSecClassGenericPassword item attributes: kSecAttrAccess (OS X only) kSecAttrAccessControl kSecAttrAccessGroup (iOS; also OS X if kSecAttrSynchronizable and/or kSecUseDataProtectionKeychain set) kSecAttrAccessible (iOS; also OS X if kSecAttrSynchronizable and/or kSecUseDataProtectionKeychain set) kSecAttrCreationDate kSecAttrModificationDate kSecAttrDescription kSecAttrComment kSecAttrCreator kSecAttrType kSecAttrLabel kSecAttrIsInvisible kSecAttrIsNegative kSecAttrAccount kSecAttrService kSecAttrGeneric kSecAttrSynchronizable
kSecClassInternetPassword item attributes: kSecAttrAccess (OS X only) kSecAttrAccessControl kSecAttrAccessGroup (iOS; also OS X if kSecAttrSynchronizable and/or kSecUseDataProtectionKeychain set) kSecAttrAccessible (iOS; also OS X if kSecAttrSynchronizable and/or kSecUseDataProtectionKeychain set) kSecAttrCreationDate kSecAttrModificationDate kSecAttrDescription kSecAttrComment kSecAttrCreator kSecAttrType kSecAttrLabel kSecAttrIsInvisible kSecAttrIsNegative kSecAttrAccount kSecAttrSecurityDomain kSecAttrServer kSecAttrProtocol kSecAttrAuthenticationType kSecAttrPort kSecAttrPath kSecAttrSynchronizable
kSecClassCertificate item attributes: kSecAttrAccessible (iOS only) kSecAttrAccessControl (iOS only) kSecAttrAccessGroup (iOS only) kSecAttrCertificateType kSecAttrCertificateEncoding kSecAttrLabel kSecAttrSubject kSecAttrIssuer kSecAttrSerialNumber kSecAttrSubjectKeyID kSecAttrPublicKeyHash kSecAttrSynchronizable
kSecClassKey item attributes: kSecAttrAccess (OS X only) kSecAttrAccessControl kSecAttrAccessGroup (iOS; also OS X if kSecAttrSynchronizable and/or kSecUseDataProtectionKeychain set) kSecAttrAccessible (iOS; also OS X if kSecAttrSynchronizable and/or kSecUseDataProtectionKeychain set) kSecAttrKeyClass kSecAttrLabel kSecAttrApplicationLabel kSecAttrIsPermanent kSecAttrApplicationTag kSecAttrKeyType kSecAttrPRF (OS X only) kSecAttrSalt (OS X only) kSecAttrRounds (OS X only) kSecAttrKeySizeInBits kSecAttrEffectiveKeySize kSecAttrCanEncrypt kSecAttrCanDecrypt kSecAttrCanDerive kSecAttrCanSign kSecAttrCanVerify kSecAttrCanWrap kSecAttrCanUnwrap kSecAttrSynchronizable
Note that the attributes kSecAttrCan* describe attributes of the key itself at relatively high level. Some of these attributes are mathematical -- for example, a DSA key cannot encrypt. Others are key-level policy issues -- for example, it is good cryptographic hygiene to use an RSA key either for encryption or signing but not both. Compare these to the certificate-level policy values in SecPolicy.h.
kSecClassIdentity item attributes: Since an identity is the combination of a private key and a certificate, this class shares attributes of both kSecClassKey and kSecClassCertificate.
[@constant] kSecAttrAccessible Specifies a dictionary key whose value indicates when your application needs access to an item's data. You should choose the most restrictive option that meets your application's needs to allow the system to protect that item in the best way possible. See the "kSecAttrAccessible Value Constants" section for a list of values which can be specified. IMPORTANT: This attribute is currently not supported for OS X keychain items, unless the kSecAttrSynchronizable attribute is also present. If both attributes are specified on either OS X or iOS, the value for the kSecAttrAccessible key may only be one whose name does not end with "ThisDeviceOnly", as those cannot sync to another device.
[@constant] kSecAttrAccessControl Specifies a dictionary key whose value is SecAccessControl instance which contains access control conditions for item. IMPORTANT: This attribute is mutually exclusive with kSecAttrAccess attribute.
[@constant] kSecAttrAccess Specifies a dictionary key whose value is a SecAccessRef describing the access control settings for this item. This key is available on OS X only.
[@constant] kSecAttrAccessGroup Specifies a dictionary key whose value is a CFStringRef indicating which access group a item is in. The access groups that a particular application has membership in are determined by two entitlements for that application. The application-identifier entitlement contains the application's single access group, unless there is a keychain-access-groups entitlement present. The latter has as its value a list of access groups; the first item in this list is the default access group. Unless a specific access group is provided as the value of kSecAttrAccessGroup when SecItemAdd is called, new items are created in the application's default access group. Specifying this attribute in SecItemCopyMatching, SecItemUpdate, or SecItemDelete calls limits the search to the specified access group (of which the calling application must be a member to obtain matching results.) To share keychain items between multiple applications, each application must have a common group listed in its keychain-access-groups entitlement, and each must specify this shared access group name as the value for the kSecAttrAccessGroup key in the dictionary passed to SecItem functions.
[@constant] kSecAttrSynchronizable Specifies a dictionary key whose value is a CFBooleanRef indicating whether the item in question can be synchronized. To add a new item which can be synced to other devices, or to obtain synchronizable results from a query, supply this key with a value of kCFBooleanTrue. If the key is not supplied, or has a value of kCFBooleanFalse, then no synchronizable items will be added or returned. A predefined value, kSecAttrSynchronizableAny, may be provided instead of kCFBooleanTrue if both synchronizable and non-synchronizable results are desired.
IMPORTANT: Specifying the kSecAttrSynchronizable key has several caveats:
- Updating or deleting items using the kSecAttrSynchronizable key will affect all copies of the item, not just the one on your local device. Be sure that it makes sense to use the same password on all devices before deciding to make a password synchronizable. - Only password items can currently be synchronized. Keychain syncing is not supported for certificates or cryptographic keys. - Items stored or obtained using the kSecAttrSynchronizable key cannot specify SecAccessRef-based access control with kSecAttrAccess. If a password is intended to be shared between multiple applications, the kSecAttrAccessGroup key must be specified, and each application using this password must have a 'keychain-access-groups' entitlement with the specified access group value. - Items stored or obtained using the kSecAttrSynchronizable key may not also specify a kSecAttrAccessible value which is incompatible with syncing (namely, those whose names end with "ThisDeviceOnly".) - Items stored or obtained using the kSecAttrSynchronizable key cannot be specified by reference. You must pass kSecReturnAttributes and/or kSecReturnData to retrieve results; kSecReturnRef is currently not supported for synchronizable items. - Persistent references to synchronizable items should be avoided; while they may work locally, they cannot be moved between devices, and may not resolve if the item is modified on some other device. - When specifying a query that uses the kSecAttrSynchronizable key, search keys are limited to the item's class and attributes. The only search constant which may be used is kSecMatchLimit; other constants using the kSecMatch prefix are not supported at this time.
[@constant] kSecAttrSynchronizableAny Specifies that both synchronizable and non-synchronizable results should be returned from this query. This may be used as a value for the kSecAttrSynchronizable dictionary key in a call to SecItemCopyMatching, SecItemUpdate, or SecItemDelete.
[@constant] kSecAttrCreationDate (read-only) Specifies a dictionary key whose value is the item's creation date. You use this key to get a value of type CFDateRef that represents the date the item was created. [@constant] kSecAttrModificationDate (read-only) Specifies a dictionary key whose value is the item's modification date. You use this key to get a value of type CFDateRef that represents the last time the item was updated. [@constant] kSecAttrDescription Specifies a dictionary key whose value is the item's description attribute. You use this key to set or get a value of type CFStringRef that represents a user-visible string describing this particular kind of item (e.g., "disk image password"). [@constant] kSecAttrComment Specifies a dictionary key whose value is the item's comment attribute. You use this key to set or get a value of type CFStringRef containing the user-editable comment for this item. [@constant] kSecAttrCreator Specifies a dictionary key whose value is the item's creator attribute. You use this key to set or get a value of type CFNumberRef that represents the item's creator. This number is the unsigned integer representation of a four-character code (e.g., 'aCrt'). [@constant] kSecAttrType Specifies a dictionary key whose value is the item's type attribute. You use this key to set or get a value of type CFNumberRef that represents the item's type. This number is the unsigned integer representation of a four-character code (e.g., 'aTyp'). [@constant] kSecAttrLabel Specifies a dictionary key whose value is the item's label attribute. You use this key to set or get a value of type CFStringRef containing the user-visible label for this item. [@constant] kSecAttrIsInvisible Specifies a dictionary key whose value is the item's invisible attribute. You use this key to set or get a value of type CFBooleanRef that indicates whether the item is invisible (i.e., should not be displayed.) [@constant] kSecAttrIsNegative Specifies a dictionary key whose value is the item's negative attribute. You use this key to set or get a value of type CFBooleanRef that indicates whether there is a valid password associated with this keychain item. This is useful if your application doesn't want a password for some particular service to be stored in the keychain, but prefers that it always be entered by the user. [@constant] kSecAttrAccount Specifies a dictionary key whose value is the item's account attribute. You use this key to set or get a CFStringRef that contains an account name. (Items of class kSecClassGenericPassword, kSecClassInternetPassword have this attribute.) [@constant] kSecAttrService Specifies a dictionary key whose value is the item's service attribute. You use this key to set or get a CFStringRef that represents the service associated with this item. (Items of class kSecClassGenericPassword have this attribute.) [@constant] kSecAttrGeneric Specifies a dictionary key whose value is the item's generic attribute. You use this key to set or get a value of CFDataRef that contains a user-defined attribute. (Items of class kSecClassGenericPassword have this attribute.) [@constant] kSecAttrSecurityDomain Specifies a dictionary key whose value is the item's security domain attribute. You use this key to set or get a CFStringRef value that represents the Internet security domain. (Items of class kSecClassInternetPassword have this attribute.) [@constant] kSecAttrServer Specifies a dictionary key whose value is the item's server attribute. You use this key to set or get a value of type CFStringRef that contains the server's domain name or IP address. (Items of class kSecClassInternetPassword have this attribute.) [@constant] kSecAttrProtocol Specifies a dictionary key whose value is the item's protocol attribute. You use this key to set or get a value of type CFNumberRef that denotes the protocol for this item (see the SecProtocolType enum in SecKeychainItem.h). (Items of class kSecClassInternetPassword have this attribute.) [@constant] kSecAttrAuthenticationType Specifies a dictionary key whose value is the item's authentication type attribute. You use this key to set or get a value of type CFNumberRef that denotes the authentication scheme for this item (see the kSecAttrAuthenticationType value constants below). [@constant] kSecAttrPort Specifies a dictionary key whose value is the item's port attribute. You use this key to set or get a CFNumberRef value that represents an Internet port number. (Items of class kSecClassInternetPassword have this attribute.) [@constant] kSecAttrPath Specifies a dictionary key whose value is the item's path attribute, typically this is the path component of the URL. You use this key to set or get a CFStringRef value that represents a path. (Items of class kSecClassInternetPassword have this attribute.) [@constant] kSecAttrSubject (read-only) Specifies a dictionary key whose value is the item's subject. You use this key to get a value of type CFDataRef that contains the X.500 subject name of a certificate. (Items of class kSecClassCertificate have this attribute.) [@constant] kSecAttrIssuer (read-only) Specifies a dictionary key whose value is the item's issuer. You use this key to get a value of type CFDataRef that contains the X.500 issuer name of a certificate. (Items of class kSecClassCertificate have this attribute.) [@constant] kSecAttrSerialNumber (read-only) Specifies a dictionary key whose value is the item's serial number. You use this key to get a value of type CFDataRef that contains the serial number data of a certificate. (Items of class kSecClassCertificate have this attribute.) [@constant] kSecAttrSubjectKeyID (read-only) Specifies a dictionary key whose value is the item's subject key ID. You use this key to get a value of type CFDataRef that contains the subject key ID of a certificate. (Items of class kSecClassCertificate have this attribute.) [@constant] kSecAttrPublicKeyHash (read-only) Specifies a dictionary key whose value is the item's public key hash. You use this key to get a value of type CFDataRef that contains the hash of a certificate's public key. (Items of class kSecClassCertificate have this attribute.) [@constant] kSecAttrCertificateType (read-only) Specifies a dictionary key whose value is the item's certificate type. You use this key to get a value of type CFNumberRef that denotes the certificate type (On iOS, currently the value of this attribute must be equal to the version of the X509 certificate. So, 1 for v1, 2 for v2, and 3 for v3 certificates). (On OSX, see the CSSM_CERT_TYPE enum in cssmtype.h). Only items of class kSecClassCertificate have this attribute. [@constant] kSecAttrCertificateEncoding (read-only) Specifies a dictionary key whose value is the item's certificate encoding. You use this key to get a value of type CFNumberRef that denotes the certificate encoding (On iOS, currently only the value 3 meaning kSecAttrCertificateEncodingDER is supported). On OSX, see the CSSM_CERT_ENCODING enum in cssmtype.h. Only items of class kSecClassCertificate have this attribute. [@constant] kSecAttrKeyClass (read only) Specifies a dictionary key whose value is one of kSecAttrKeyClassPublic, kSecAttrKeyClassPrivate or kSecAttrKeyClassSymmetric. [@constant] kSecAttrApplicationLabel Specifies a dictionary key whose value is the key's application label attribute. This is different from the kSecAttrLabel (which is intended to be human-readable). This attribute is used to look up a key programmatically; in particular, for keys of class kSecAttrKeyClassPublic and kSecAttrKeyClassPrivate, the value of this attribute is the hash of the public key. This item is a type of CFDataRef. Legacy keys may contain a UUID in this field as a CFStringRef. [@constant] kSecAttrIsPermanent Specifies a dictionary key whose value is a CFBooleanRef indicating whether the key in question will be stored permanently. [@constant] kSecAttrIsSensitive Specifies a dictionary key whose value is a CFBooleanRef indicating that the key in question can only be exported in a wrapped (encrypted) format. OS X only. [@constant] kSecAttrIsExtractable Specifies a dictionary key whose value is a CFBooleanRef indicating whether the key in question can be exported from its keychain container. OS X only. [@constant] kSecAttrApplicationTag Specifies a dictionary key whose value is a CFDataRef containing private tag data. [@constant] kSecAttrKeyType Specifies a dictionary key whose value is a CFNumberRef indicating the algorithm associated with this key (On iOS, currently only the value 42 is supported, alternatively you can use kSecAttrKeyTypeRSA). (On OSX, see the CSSM_ALGORITHMS enum in cssmtype.h).
[@constant] kSecAttrPRF Specifies a dictionary key whose value is the PRF (pseudo-random function) for this key (see "kSecAttrPRF Value Constants".) OS X only. [@constant] kSecAttrSalt Specifies a dictionary key whose value is a CFData containing the salt to use for this key. OS X only. [@constant] kSecAttrRounds Specifies a dictionary key whose value is the number of rounds for the pseudo-random function specified by kSecAttrPRF. OS X only. [@constant] kSecAttrKeySizeInBits Specifies a dictionary key whose value is a CFNumberRef indicating the number of bits in this key. [@constant] kSecAttrEffectiveKeySize Specifies a dictionary key whose value is a CFNumberRef indicating the effective number of bits in this key. For example, a DES key has a kSecAttrKeySizeInBits of 64, but a kSecAttrEffectiveKeySize of 56 bits. [@constant] kSecAttrCanEncrypt Specifies a dictionary key whole value is a CFBooleanRef indicating whether the key in question can be used to encrypt data. [@constant] kSecAttrCanDecrypt Specifies a dictionary key whose value is a CFBooleanRef indicating whether the key in question can be used to decrypt data. [@constant] kSecAttrCanDerive Specifies a dictionary key whole value is a CFBooleanRef indicating whether the key in question can be used to derive another key. [@constant] kSecAttrCanSign Specifies a dictionary key whole value is a CFBooleanRef indicating whether the key in question can be used to create a digital signature. [@constant] kSecAttrCanVerify Specifies a dictionary key whole value is a CFBooleanRef indicating whether the key in question can be used to verify a digital signature. [@constant] kSecAttrCanWrap Specifies a dictionary key whole value is a CFBooleanRef indicating whether the key in question can be used to wrap another key. [@constant] kSecAttrCanUnwrap Specifies a dictionary key whole value is a CFBooleanRef indicating whether the key in question can be used to unwrap another key. [@constant] kSecAttrSyncViewHint Specifies a dictionary key whose value is a CFStringRef. This value is part of the primary key of each item, and can be used to help distiguish Sync Views when defining their queries. iOS and sychronizable items only. [@constant] kSecAttrTokenID Specifies a dictionary key whose presence indicates that item is backed by external token. Value of this attribute is CFStringRef uniquely identifying containing token. When this attribute is not present, item is stored in internal keychain database. Note that once item is created, this attribute cannot be changed - in other words it is not possible to migrate existing items to, from or between tokens. Currently the only available value for this attribute is kSecAttrTokenIDSecureEnclave, which indicates that item (private key) is backed by device's Secure Enclave.
public static CFStringRef kSecAttrAccessControl()
public static CFStringRef kSecAttrAccessGroup()
public static CFStringRef kSecAttrSynchronizable()
public static CFStringRef kSecAttrCreationDate()
public static CFStringRef kSecAttrModificationDate()
public static CFStringRef kSecAttrDescription()
public static CFStringRef kSecAttrComment()
public static CFStringRef kSecAttrCreator()
public static CFStringRef kSecAttrType()
public static CFStringRef kSecAttrLabel()
public static CFStringRef kSecAttrIsInvisible()
public static CFStringRef kSecAttrIsNegative()
public static CFStringRef kSecAttrAccount()
public static CFStringRef kSecAttrService()
public static CFStringRef kSecAttrGeneric()
public static CFStringRef kSecAttrSecurityDomain()
public static CFStringRef kSecAttrServer()
public static CFStringRef kSecAttrProtocol()
public static CFStringRef kSecAttrAuthenticationType()
public static CFStringRef kSecAttrPort()
public static CFStringRef kSecAttrPath()
public static CFStringRef kSecAttrSubject()
public static CFStringRef kSecAttrIssuer()
public static CFStringRef kSecAttrSerialNumber()
public static CFStringRef kSecAttrSubjectKeyID()
public static CFStringRef kSecAttrPublicKeyHash()
public static CFStringRef kSecAttrCertificateType()
public static CFStringRef kSecAttrCertificateEncoding()
public static CFStringRef kSecAttrKeyClass()
public static CFStringRef kSecAttrApplicationLabel()
public static CFStringRef kSecAttrIsPermanent()
public static CFStringRef kSecAttrApplicationTag()
public static CFStringRef kSecAttrKeyType()
public static CFStringRef kSecAttrKeySizeInBits()
public static CFStringRef kSecAttrEffectiveKeySize()
public static CFStringRef kSecAttrCanEncrypt()
public static CFStringRef kSecAttrCanDecrypt()
public static CFStringRef kSecAttrCanDerive()
public static CFStringRef kSecAttrCanSign()
public static CFStringRef kSecAttrCanVerify()
public static CFStringRef kSecAttrCanWrap()
public static CFStringRef kSecAttrCanUnwrap()
public static CFStringRef kSecAttrSyncViewHint()
public static CFStringRef kSecAttrTokenID()
public static CFStringRef kSecAttrAccessibleWhenUnlocked()
Predefined item attribute constants used to get or set values in a dictionary. The kSecAttrAccessible constant is the key and its value is one of the constants defined here. When asking SecItemCopyMatching to return the item's data, the error errSecInteractionNotAllowed will be returned if the item's data is not available until a device unlock occurs. [@constant] kSecAttrAccessibleWhenUnlocked Item data can only be accessed while the device is unlocked. This is recommended for items that only need be accesible while the application is in the foreground. Items with this attribute will migrate to a new device when using encrypted backups. [@constant] kSecAttrAccessibleAfterFirstUnlock Item data can only be accessed once the device has been unlocked after a restart. This is recommended for items that need to be accesible by background applications. Items with this attribute will migrate to a new device when using encrypted backups. [@constant] kSecAttrAccessibleAlways Item data can always be accessed regardless of the lock state of the device. This is not recommended for anything except system use. Items with this attribute will migrate to a new device when using encrypted backups. [@constant] kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly Item data can only be accessed while the device is unlocked. This is recommended for items that only need to be accessible while the application is in the foreground and requires a passcode to be set on the device. Items with this attribute will never migrate to a new device, so after a backup is restored to a new device, these items will be missing. This attribute will not be available on devices without a passcode. Disabling the device passcode will cause all previously protected items to be deleted. [@constant] kSecAttrAccessibleWhenUnlockedThisDeviceOnly Item data can only be accessed while the device is unlocked. This is recommended for items that only need be accesible while the application is in the foreground. Items with this attribute will never migrate to a new device, so after a backup is restored to a new device, these items will be missing. [@constant] kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly Item data can only be accessed once the device has been unlocked after a restart. This is recommended for items that need to be accessible by background applications. Items with this attribute will never migrate to a new device, so after a backup is restored to a new device these items will be missing. [@constant] kSecAttrAccessibleAlwaysThisDeviceOnly Item data can always be accessed regardless of the lock state of the device. This option is not recommended for anything except system use. Items with this attribute will never migrate to a new device, so after a backup is restored to a new device, these items will be missing.
public static CFStringRef kSecAttrAccessibleAfterFirstUnlock()
public static CFStringRef kSecAttrAccessibleAlways()
public static CFStringRef kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly()
public static CFStringRef kSecAttrAccessibleWhenUnlockedThisDeviceOnly()
public static CFStringRef kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly()
public static CFStringRef kSecAttrAccessibleAlwaysThisDeviceOnly()
public static CFStringRef kSecAttrProtocolFTP()
Predefined item attribute constants used to get or set values in a dictionary. The kSecAttrProtocol constant is the key and its value is one of the constants defined here. [@constant] kSecAttrProtocolFTP. [@constant] kSecAttrProtocolFTPAccount. [@constant] kSecAttrProtocolHTTP. [@constant] kSecAttrProtocolIRC. [@constant] kSecAttrProtocolNNTP. [@constant] kSecAttrProtocolPOP3. [@constant] kSecAttrProtocolSMTP. [@constant] kSecAttrProtocolSOCKS. [@constant] kSecAttrProtocolIMAP. [@constant] kSecAttrProtocolLDAP. [@constant] kSecAttrProtocolAppleTalk. [@constant] kSecAttrProtocolAFP. [@constant] kSecAttrProtocolTelnet. [@constant] kSecAttrProtocolSSH. [@constant] kSecAttrProtocolFTPS. [@constant] kSecAttrProtocolHTTPS. [@constant] kSecAttrProtocolHTTPProxy. [@constant] kSecAttrProtocolHTTPSProxy. [@constant] kSecAttrProtocolFTPProxy. [@constant] kSecAttrProtocolSMB. [@constant] kSecAttrProtocolRTSP. [@constant] kSecAttrProtocolRTSPProxy. [@constant] kSecAttrProtocolDAAP. [@constant] kSecAttrProtocolEPPC. [@constant] kSecAttrProtocolIPP. [@constant] kSecAttrProtocolNNTPS. [@constant] kSecAttrProtocolLDAPS. [@constant] kSecAttrProtocolTelnetS. [@constant] kSecAttrProtocolIMAPS. [@constant] kSecAttrProtocolIRCS. [@constant] kSecAttrProtocolPOP3S.
public static CFStringRef kSecAttrProtocolFTPAccount()
public static CFStringRef kSecAttrProtocolHTTP()
public static CFStringRef kSecAttrProtocolIRC()
public static CFStringRef kSecAttrProtocolNNTP()
public static CFStringRef kSecAttrProtocolPOP3()
public static CFStringRef kSecAttrProtocolSMTP()
public static CFStringRef kSecAttrProtocolSOCKS()
public static CFStringRef kSecAttrProtocolIMAP()
public static CFStringRef kSecAttrProtocolLDAP()
public static CFStringRef kSecAttrProtocolAppleTalk()
public static CFStringRef kSecAttrProtocolAFP()
public static CFStringRef kSecAttrProtocolTelnet()
public static CFStringRef kSecAttrProtocolSSH()
public static CFStringRef kSecAttrProtocolFTPS()
public static CFStringRef kSecAttrProtocolHTTPS()
public static CFStringRef kSecAttrProtocolHTTPProxy()
public static CFStringRef kSecAttrProtocolHTTPSProxy()
public static CFStringRef kSecAttrProtocolFTPProxy()
public static CFStringRef kSecAttrProtocolSMB()
public static CFStringRef kSecAttrProtocolRTSP()
public static CFStringRef kSecAttrProtocolRTSPProxy()
public static CFStringRef kSecAttrProtocolDAAP()
public static CFStringRef kSecAttrProtocolEPPC()
public static CFStringRef kSecAttrProtocolIPP()
public static CFStringRef kSecAttrProtocolNNTPS()
public static CFStringRef kSecAttrProtocolLDAPS()
public static CFStringRef kSecAttrProtocolTelnetS()
public static CFStringRef kSecAttrProtocolIMAPS()
public static CFStringRef kSecAttrProtocolIRCS()
public static CFStringRef kSecAttrProtocolPOP3S()
public static CFStringRef kSecAttrAuthenticationTypeNTLM()
Predefined item attribute constants used to get or set values in a dictionary. The kSecAttrAuthenticationType constant is the key and its value is one of the constants defined here. [@constant] kSecAttrAuthenticationTypeNTLM. [@constant] kSecAttrAuthenticationTypeMSN. [@constant] kSecAttrAuthenticationTypeDPA. [@constant] kSecAttrAuthenticationTypeRPA. [@constant] kSecAttrAuthenticationTypeHTTPBasic. [@constant] kSecAttrAuthenticationTypeHTTPDigest. [@constant] kSecAttrAuthenticationTypeHTMLForm. [@constant] kSecAttrAuthenticationTypeDefault.
public static CFStringRef kSecAttrAuthenticationTypeMSN()
public static CFStringRef kSecAttrAuthenticationTypeDPA()
public static CFStringRef kSecAttrAuthenticationTypeRPA()
public static CFStringRef kSecAttrAuthenticationTypeHTTPBasic()
public static CFStringRef kSecAttrAuthenticationTypeHTTPDigest()
public static CFStringRef kSecAttrAuthenticationTypeHTMLForm()
public static CFStringRef kSecAttrAuthenticationTypeDefault()
public static CFStringRef kSecAttrKeyClassPublic()
Predefined item attribute constants used to get or set values in a dictionary. The kSecAttrKeyClass constant is the key and its value is one of the constants defined here. [@constant] kSecAttrKeyClassPublic. [@constant] kSecAttrKeyClassPrivate. [@constant] kSecAttrKeyClassSymmetric.
public static CFStringRef kSecAttrKeyClassPrivate()
public static CFStringRef kSecAttrKeyClassSymmetric()
public static CFStringRef kSecAttrKeyTypeRSA()
Predefined item attribute constants used to get or set values in a dictionary. The kSecAttrKeyType constant is the key and its value is one of the constants defined here. [@constant] kSecAttrKeyTypeECSECPrimeRandom. The used curve is P-192, P-256, P-384 or P-521. The size is specified by kSecAttrKeySizeInBits attribute. Curves are defined in FIPS PUB 186-4 standard. [@constant] kSecAttrKeyTypeEC This is the legacy name for kSecAttrKeyTypeECSECPrimeRandom, new applications should not use it. [@constant] kSecAttrKeyTypeDSA (OSX only) [@constant] kSecAttrKeyTypeAES (OSX only) [@constant] kSecAttrKeyType3DES (OSX only) [@constant] kSecAttrKeyTypeRC4 (OSX only) [@constant] kSecAttrKeyTypeRC2 (OSX only) [@constant] kSecAttrKeyTypeCAST (OSX only) [@constant] kSecAttrKeyTypeECDSA (deprecated; use kSecAttrKeyTypeECSECPrimeRandom instead.) (OSX only)
public static CFStringRef kSecAttrKeyTypeEC()
public static CFStringRef kSecAttrKeyTypeECSECPrimeRandom()
public static CFStringRef kSecAttrSynchronizableAny()
public static CFStringRef kSecMatchPolicy()
Predefined search constants used to set values in a query dictionary. You can specify a combination of search attributes and item attributes when looking for matching items with the SecItemCopyMatching function. [@constant] kSecMatchPolicy Specifies a dictionary key whose value is a SecPolicyRef. If provided, returned certificates or identities must verify with this policy. [@constant] kSecMatchItemList OS X only. Specifies a dictionary key whose value is a CFArray of SecKeychainItemRef items. If provided, returned items will be limited to the subset which are contained in this list. [@constant] kSecMatchSearchList Specifies a dictionary key whose value is a CFArray of SecKeychainRef items. If provided, the search will be limited to the keychains contained in this list. [@constant] kSecMatchIssuers Specifies a dictionary key whose value is a CFArray of X.500 names (of type CFDataRef). If provided, returned certificates or identities will be limited to those whose certificate chain contains one of the issuers provided in this list. [@constant] kSecMatchEmailAddressIfPresent Specifies a dictionary key whose value is a CFStringRef containing an RFC822 email address. If provided, returned certificates or identities will be limited to those that contain the address, or do not contain any email address. [@constant] kSecMatchSubjectContains Specifies a dictionary key whose value is a CFStringRef. If provided, returned certificates or identities will be limited to those containing this string in the subject. [@constant] kSecMatchSubjectStartsWith OS X only. Specifies a dictionary key whose value is a CFStringRef. If provided, returned certificates or identities will be limited to those with subject names that start with this string. [@constant] kSecMatchSubjectEndsWith OS X only. Specifies a dictionary key whose value is a CFStringRef. If provided, returned certificates or identities will be limited to those with subject names that end with this string. [@constant] kSecMatchSubjectWholeString OS X only. Specifies a dictionary key whose value is a CFStringRef. If provided, returned certificates or identities will be limited to those matching this string exactly in the subject. [@constant] kSecMatchCaseInsensitive Specifies a dictionary key whose value is a CFBooleanRef. If this value is kCFBooleanFalse, or is not provided, then case-sensitive string matching is performed. [@constant] kSecMatchDiacriticInsensitive OS X only. Specifies a dictionary key whose value is a CFBooleanRef. If this value is kCFBooleanFalse, or is not provided, then diacritic-sensitive string matching is performed. [@constant] kSecMatchWidthInsensitive OS X only. Specifies a dictionary key whose value is a CFBooleanRef. If this value is kCFBooleanFalse, or is not provided, then string matching is width-sensitive (e.g. 'a' != 0xFF41). [@constant] kSecMatchTrustedOnly Specifies a dictionary key whose value is a CFBooleanRef. If provided with a value of kCFBooleanTrue, only certificates which can be verified back to a trusted anchor will be returned. If this value is kCFBooleanFalse, or is not provided, then both trusted and untrusted certificates may be returned. [@constant] kSecMatchValidOnDate Specifies a dictionary key whose value is of type CFDateRef. If provided, returned keys, certificates or identities will be limited to those which are valid for the given date. Pass a value of kCFNull to indicate the current date. [@constant] kSecMatchLimit Specifies a dictionary key whose value is a CFNumberRef. If provided, this value specifies the maximum number of results to return. If not provided, results are limited to the first item found. Predefined values are provided for a single item (kSecMatchLimitOne) and all matching items (kSecMatchLimitAll). [@constant] kSecMatchLimitOne Specifies that results are limited to the first item found; used as a value for the kSecMatchLimit dictionary key. [@constant] kSecMatchLimitAll Specifies that an unlimited number of results may be returned; used as a value for the kSecMatchLimit dictionary key.
public static CFStringRef kSecMatchItemList()
public static CFStringRef kSecMatchSearchList()
public static CFStringRef kSecMatchIssuers()
public static CFStringRef kSecMatchEmailAddressIfPresent()
public static CFStringRef kSecMatchSubjectContains()
public static CFStringRef kSecMatchCaseInsensitive()
public static CFStringRef kSecMatchTrustedOnly()
public static CFStringRef kSecMatchValidOnDate()
public static CFStringRef kSecMatchLimit()
public static CFStringRef kSecMatchLimitOne()
public static CFStringRef kSecMatchLimitAll()
public static CFStringRef kSecReturnData()
Predefined return type keys used to set values in a dictionary. You use these keys to specify the type of results which should be returned by the SecItemCopyMatching or SecItemAdd function. You can specify zero or more of these return types. If more than one of these result types is specified, the result is returned as a CFDictionaryRef whose keys are the result types and values are the requested data. [@constant] kSecReturnData Specifies a dictionary key whose value is of type CFBooleanRef. A value of kCFBooleanTrue indicates that the data of an item (CFDataRef) should be returned. For keys and password items, data is secret (encrypted) and may require the user to enter a password for access. [@constant] kSecReturnAttributes Specifies a dictionary key whose value is of type CFBooleanRef. A value of kCFBooleanTrue indicates that the (non-encrypted) attributes of an item (CFDictionaryRef) should be returned. [@constant] kSecReturnRef Specifies a dictionary key whose value is a CFBooleanRef. A value of kCFBooleanTrue indicates that a reference should be returned. Depending on the item class requested, the returned reference(s) may be of type SecKeychainItemRef, SecKeyRef, SecCertificateRef, or SecIdentityRef. [@constant] kSecReturnPersistentRef Specifies a dictionary key whose value is of type CFBooleanRef. A value of kCFBooleanTrue indicates that a persistent reference to an item (CFDataRef) should be returned.
public static CFStringRef kSecReturnAttributes()
public static CFStringRef kSecReturnRef()
public static CFStringRef kSecReturnPersistentRef()
public static CFStringRef kSecValueData()
Predefined value type keys used to pass values in a dictionary. You can specify zero or more of these types depending on the function you are calling. For SecItemCopyMatching or SecItemAdd these are used as keys in the results dictionary. [@constant] kSecValueData Specifies a dictionary key whose value is of type CFDataRef. For keys and password items, data is secret (encrypted) and may require the user to enter a password for access. [@constant] kSecValueRef Specifies a dictionary key whose value, depending on the item class requested, is of type SecKeychainItemRef, SecKeyRef, SecCertificateRef, or SecIdentityRef. [@constant] kSecValuePersistentRef Specifies a dictionary key whose value is of type CFDataRef. The bytes in this CFDataRef can be stored by the caller and used on a subsequent invocation of the application (or even a different application) to retrieve the item referenced by it.
public static CFStringRef kSecValueRef()
public static CFStringRef kSecValuePersistentRef()
public static CFStringRef kSecUseItemList()
Predefined constants used to set values in a dictionary. [@constant] kSecUseItemList Specifies a dictionary key whose value is a CFArray of items. If provided, this array is treated as the set of all possible items to search, or add if the API being called is SecItemAdd. The items in this array may be of type SecKeyRef, SecCertificateRef, SecIdentityRef, or CFDataRef (for a persistent item reference.) The items in the array must all be of the same type. When this attribute is provided, no keychains are searched. [@constant] kSecUseKeychain OS X only. Specifies a dictionary key whose value is a keychain reference. You use this key to specify a value of type SecKeychainRef to which SecItemAdd will add the provided item(s). [@constant] kSecUseOperationPrompt Specifies a dictionary key whose value is a CFStringRef that represents a user-visible string describing the operation for which the application is attempting to authenticate. The application is responsible for the text localization. [@constant] kSecUseNoAuthenticationUI OS X only. Specifies a dictionary key whose value is a CFBooleanRef. If provided with a value of kCFBooleanTrue, the error errSecInteractionNotAllowed will be returned if the item is attempting to authenticate with UI. [@constant] kSecUseAuthenticationUI Specifies a dictionary key whose value is one of kSecUseAuthenticationUIAllow, kSecUseAuthenticationUIFail, kSecUseAuthenticationUISkip. [@constant] kSecUseAuthenticationContext Specifies a dictionary key whose value is LAContext to be used for keychain item authentication. * If the item requires authentication and this key is omitted, a new context will be created just for the purpose of the single call. * If the specified context has been previously authenticated, the operation will succeed without asking user for authentication. * If the specified context has not been previously authenticated, the new authentication will be started on this context, allowing caller to eventually reuse the successfully authenticated context in subsequent keychain operations. [@constant] kSecUseDataProtectionKeychain Specifies a dictionary key whose value is a CFBooleanRef. Set to kCFBooleanTrue to use kSecAttrAccessGroup and/or kSecAttrAccessible on macOS without requiring the item to be marked synchronizable.
public static CFStringRef kSecUseOperationPrompt()
@Deprecated public static CFStringRef kSecUseNoAuthenticationUI()
public static CFStringRef kSecUseAuthenticationUI()
public static CFStringRef kSecUseAuthenticationContext()
public static CFStringRef kSecUseAuthenticationUIAllow()
Predefined item attribute constants used to get or set values in a dictionary. The kSecUseAuthenticationUI constant is the key and its value is one of the constants defined here. If the key kSecUseAuthenticationUI not provided then kSecUseAuthenticationUIAllow is used as default. [@constant] kSecUseAuthenticationUIAllow Specifies that authenticate UI can appear. [@constant] kSecUseAuthenticationUIFail Specifies that the error errSecInteractionNotAllowed will be returned if an item needs to authenticate with UI [@constant] kSecUseAuthenticationUIAllowSkip Specifies that all items which need to authenticate with UI will be silently skipped. This value can be used only with SecItemCopyMatching.
public static CFStringRef kSecUseAuthenticationUIFail()
public static CFStringRef kSecUseAuthenticationUISkip()
public static CFStringRef kSecAttrTokenIDSecureEnclave()
Predefined item attribute constant used to get or set values in a dictionary. The kSecAttrTokenID constant is the key and its value can be kSecAttrTokenIDSecureEnclave. [@constant] kSecAttrTokenIDSecureEnclave Specifies well-known identifier of the token implemented using device's Secure Enclave. The only keychain items supported by the Secure Enclave token are 256-bit elliptic curve keys (kSecAttrKeyTypeECSecPrimeRandom). Keys must be generated on the secure enclave using SecKeyGenerateKeyPair call with kSecAttrTokenID set to kSecAttrTokenIDSecureEnclave in the parameters dictionary, it is not possible to import pregenerated keys to kSecAttrTokenIDSecureEnclave token.
public static CFStringRef kSecAttrAccessGroupToken()
public static CFStringRef kSecPrivateKeyAttrs()
Predefined key constants used to get or set values in a dictionary. These are used to provide explicit parameters to key generation functions when non-default values are desired. See the description of the SecKeyGeneratePair API for usage information. [@constant] kSecPrivateKeyAttrs The value for this key is a CFDictionaryRef containing attributes specific for the private key to be generated. [@constant] kSecPublicKeyAttrs The value for this key is a CFDictionaryRef containing attributes specific for the public key to be generated.
public static CFStringRef kSecPublicKeyAttrs()
public static CFStringRef kSecKeyAlgorithmRSASignatureRaw()
public static CFStringRef kSecKeyAlgorithmRSASignatureDigestPKCS1v15Raw()
public static CFStringRef kSecKeyAlgorithmRSASignatureDigestPKCS1v15SHA1()
public static CFStringRef kSecKeyAlgorithmRSASignatureDigestPKCS1v15SHA224()
public static CFStringRef kSecKeyAlgorithmRSASignatureDigestPKCS1v15SHA256()
public static CFStringRef kSecKeyAlgorithmRSASignatureDigestPKCS1v15SHA384()
public static CFStringRef kSecKeyAlgorithmRSASignatureDigestPKCS1v15SHA512()
public static CFStringRef kSecKeyAlgorithmRSASignatureMessagePKCS1v15SHA1()
public static CFStringRef kSecKeyAlgorithmRSASignatureMessagePKCS1v15SHA224()
public static CFStringRef kSecKeyAlgorithmRSASignatureMessagePKCS1v15SHA256()
public static CFStringRef kSecKeyAlgorithmRSASignatureMessagePKCS1v15SHA384()
public static CFStringRef kSecKeyAlgorithmRSASignatureMessagePKCS1v15SHA512()
public static CFStringRef kSecKeyAlgorithmECDSASignatureRFC4754()
public static CFStringRef kSecKeyAlgorithmECDSASignatureDigestX962()
public static CFStringRef kSecKeyAlgorithmECDSASignatureDigestX962SHA1()
public static CFStringRef kSecKeyAlgorithmECDSASignatureDigestX962SHA224()
public static CFStringRef kSecKeyAlgorithmECDSASignatureDigestX962SHA256()
public static CFStringRef kSecKeyAlgorithmECDSASignatureDigestX962SHA384()
public static CFStringRef kSecKeyAlgorithmECDSASignatureDigestX962SHA512()
public static CFStringRef kSecKeyAlgorithmECDSASignatureMessageX962SHA1()
public static CFStringRef kSecKeyAlgorithmECDSASignatureMessageX962SHA224()
public static CFStringRef kSecKeyAlgorithmECDSASignatureMessageX962SHA256()
public static CFStringRef kSecKeyAlgorithmECDSASignatureMessageX962SHA384()
public static CFStringRef kSecKeyAlgorithmECDSASignatureMessageX962SHA512()
public static CFStringRef kSecKeyAlgorithmRSAEncryptionRaw()
public static CFStringRef kSecKeyAlgorithmRSAEncryptionPKCS1()
public static CFStringRef kSecKeyAlgorithmRSAEncryptionOAEPSHA1()
public static CFStringRef kSecKeyAlgorithmRSAEncryptionOAEPSHA224()
public static CFStringRef kSecKeyAlgorithmRSAEncryptionOAEPSHA256()
public static CFStringRef kSecKeyAlgorithmRSAEncryptionOAEPSHA384()
public static CFStringRef kSecKeyAlgorithmRSAEncryptionOAEPSHA512()
public static CFStringRef kSecKeyAlgorithmRSAEncryptionOAEPSHA1AESGCM()
public static CFStringRef kSecKeyAlgorithmRSAEncryptionOAEPSHA224AESGCM()
public static CFStringRef kSecKeyAlgorithmRSAEncryptionOAEPSHA256AESGCM()
public static CFStringRef kSecKeyAlgorithmRSAEncryptionOAEPSHA384AESGCM()
public static CFStringRef kSecKeyAlgorithmRSAEncryptionOAEPSHA512AESGCM()
public static CFStringRef kSecKeyAlgorithmECIESEncryptionStandardX963SHA1AESGCM()
public static CFStringRef kSecKeyAlgorithmECIESEncryptionStandardX963SHA224AESGCM()
public static CFStringRef kSecKeyAlgorithmECIESEncryptionStandardX963SHA256AESGCM()
public static CFStringRef kSecKeyAlgorithmECIESEncryptionStandardX963SHA384AESGCM()
public static CFStringRef kSecKeyAlgorithmECIESEncryptionStandardX963SHA512AESGCM()
public static CFStringRef kSecKeyAlgorithmECIESEncryptionCofactorX963SHA1AESGCM()
public static CFStringRef kSecKeyAlgorithmECIESEncryptionCofactorX963SHA224AESGCM()
public static CFStringRef kSecKeyAlgorithmECIESEncryptionCofactorX963SHA256AESGCM()
public static CFStringRef kSecKeyAlgorithmECIESEncryptionCofactorX963SHA384AESGCM()
public static CFStringRef kSecKeyAlgorithmECIESEncryptionCofactorX963SHA512AESGCM()
public static CFStringRef kSecKeyAlgorithmECDHKeyExchangeStandard()
public static CFStringRef kSecKeyAlgorithmECDHKeyExchangeStandardX963SHA1()
public static CFStringRef kSecKeyAlgorithmECDHKeyExchangeStandardX963SHA224()
public static CFStringRef kSecKeyAlgorithmECDHKeyExchangeStandardX963SHA256()
public static CFStringRef kSecKeyAlgorithmECDHKeyExchangeStandardX963SHA384()
public static CFStringRef kSecKeyAlgorithmECDHKeyExchangeStandardX963SHA512()
public static CFStringRef kSecKeyAlgorithmECDHKeyExchangeCofactor()
public static CFStringRef kSecKeyAlgorithmECDHKeyExchangeCofactorX963SHA1()
public static CFStringRef kSecKeyAlgorithmECDHKeyExchangeCofactorX963SHA224()
public static CFStringRef kSecKeyAlgorithmECDHKeyExchangeCofactorX963SHA256()
public static CFStringRef kSecKeyAlgorithmECDHKeyExchangeCofactorX963SHA384()
public static CFStringRef kSecKeyAlgorithmECDHKeyExchangeCofactorX963SHA512()
public static CFStringRef kSecKeyKeyExchangeParameterRequestedSize()
public static CFStringRef kSecKeyKeyExchangeParameterSharedInfo()
public static CFStringRef kSecPolicyAppleX509Basic()
Predefined constants used to specify a policy. [@constant] kSecPolicyAppleX509Basic [@constant] kSecPolicyAppleSSL [@constant] kSecPolicyAppleSMIME [@constant] kSecPolicyAppleEAP [@constant] kSecPolicyAppleiChat [@constant] kSecPolicyAppleIPsec [@constant] kSecPolicyApplePKINITClient [@constant] kSecPolicyApplePKINITServer [@constant] kSecPolicyAppleCodeSigning [@constant] kSecPolicyMacAppStoreReceipt [@constant] kSecPolicyAppleIDValidation [@constant] kSecPolicyAppleTimeStamping [@constant] kSecPolicyAppleRevocation [@constant] kSecPolicyApplePassbookSigning [@constant] kSecPolicyApplePayIssuerEncryption
public static CFStringRef kSecPolicyAppleSSL()
public static CFStringRef kSecPolicyAppleSMIME()
public static CFStringRef kSecPolicyAppleEAP()
public static CFStringRef kSecPolicyAppleIPsec()
public static CFStringRef kSecPolicyAppleCodeSigning()
public static CFStringRef kSecPolicyMacAppStoreReceipt()
public static CFStringRef kSecPolicyAppleIDValidation()
public static CFStringRef kSecPolicyAppleTimeStamping()
public static CFStringRef kSecPolicyAppleRevocation()
public static CFStringRef kSecPolicyApplePassbookSigning()
public static CFStringRef kSecPolicyApplePayIssuerEncryption()
public static CFStringRef kSecPolicyOid()
Predefined property key constants used to get or set values in a dictionary for a policy instance.
All policies will have the following read-only value: kSecPolicyOid (the policy object identifier)
Additional policy values which your code can optionally set: kSecPolicyName (name which must be matched) kSecPolicyClient (evaluate for client, rather than server) kSecPolicyRevocationFlags (only valid for a revocation policy) kSecPolicyTeamIdentifier (only valid for a Passbook signing policy)
[@constant] kSecPolicyOid Specifies the policy OID (value is a CFStringRef) [@constant] kSecPolicyName Specifies a CFStringRef (or CFArrayRef of same) containing a name which must be matched in the certificate to satisfy this policy. For SSL/TLS, EAP, and IPSec policies, this specifies the server name which must match the common name of the certificate. For S/MIME, this specifies the RFC822 email address. For Passbook signing, this specifies the pass signer. [@constant] kSecPolicyClient Specifies a CFBooleanRef value that indicates this evaluation should be for a client certificate. If not set (or false), the policy evaluates the certificate as a server certificate. [@constant] kSecPolicyRevocationFlags Specifies a CFNumberRef that holds a kCFNumberCFIndexType bitmask value. See "Revocation Policy Constants" for a description of individual bits in this value. [@constant] kSecPolicyTeamIdentifier Specifies a CFStringRef containing a team identifier which must be matched in the certificate to satisfy this policy. For the Passbook signing policy, this string must match the Organizational Unit field of the certificate subject.
public static CFStringRef kSecPolicyName()
public static CFStringRef kSecPolicyClient()
public static CFStringRef kSecPolicyRevocationFlags()
public static CFStringRef kSecPolicyTeamIdentifier()
public static SecRandomRef kSecRandomDefault()
public static CFStringRef kSecSharedPassword()
Predefined key constants used to get values in a dictionary of credentials returned by SecRequestWebCredential. [@constant] kSecSharedPassword Specifies a dictionary key whose value is a shared password. You use this key to get a value of type CFStringRef that contains a password.
public static CFStringRef kSecPropertyTypeTitle()
Predefined key constants used to obtain values in a per-certificate dictionary of trust evaluation results, as retrieved from a call to SecTrustCopyProperties. [@constant] kSecPropertyTypeTitle Specifies a key whose value is a CFStringRef containing the title (display name) of this certificate. [@constant] kSecPropertyTypeError Specifies a key whose value is a CFStringRef containing the reason for a trust evaluation failure.
public static CFStringRef kSecPropertyTypeError()
public static CFStringRef kSecTrustEvaluationDate()
Predefined key constants used to obtain values in a dictionary of trust evaluation results for a certificate chain, as retrieved from a call to SecTrustCopyResult. [@constant] kSecTrustEvaluationDate This key will be present if a trust evaluation has been performed and results are available. Its value is a CFDateRef representing when the evaluation for this trust object took place. [@constant] kSecTrustExtendedValidation This key will be present and have a value of kCFBooleanTrue if this chain was validated for EV. [@constant] kSecTrustOrganizationName Organization name field of subject of leaf certificate. This field is meant to be displayed to the user as the validated name of the company or entity that owns the certificate if the kSecTrustExtendedValidation key is present. [@constant] kSecTrustResultValue This key will be present if a trust evaluation has been performed. Its value is a CFNumberRef representing the SecTrustResultType result for the evaluation. [@constant] kSecTrustRevocationChecked This key will be present iff this chain had its revocation checked. The value will be a kCFBooleanTrue if revocation checking was successful and none of the certificates in the chain were revoked. The value will be kCFBooleanFalse if no current revocation status could be obtained for one or more certificates in the chain due to connection problems or timeouts. This is a hint to a client to retry revocation checking at a later time. [@constant] kSecTrustRevocationValidUntilDate This key will be present iff kSecTrustRevocationChecked has a value of kCFBooleanTrue. The value will be a CFDateRef representing the earliest date at which the revocation info for one of the certificates in this chain might change. [@constant] kSecTrustCertificateTransparency This key will be present and have a value of kCFBooleanTrue if this chain is CT qualified. [@constant] kSecTrustCertificateTransparencyWhiteList This key will be present and have a value of kCFBooleanTrue if this chain is EV, but not CT qualified, and is permitted as an exception to CT policy requirements. Note: in macOS 10.12 and iOS 10, previously-issued EV certificates were considered exempt from the CT requirement. As those certificates expired, exempting them was no longer needed. This key is deprecated in macOS 10.13 and iOS 11, and is no longer returned in the trust results dictionary as of those releases.
public static CFStringRef kSecTrustExtendedValidation()
public static CFStringRef kSecTrustOrganizationName()
public static CFStringRef kSecTrustResultValue()
public static CFStringRef kSecTrustRevocationChecked()
public static CFStringRef kSecTrustRevocationValidUntilDate()
public static CFStringRef kSecTrustCertificateTransparency()
public static CFStringRef kSecTrustCertificateTransparencyWhiteList()
public static CFStringRef kSSLSessionConfig_default()
public static CFStringRef kSSLSessionConfig_ATSv1()
public static CFStringRef kSSLSessionConfig_ATSv1_noPFS()
public static CFStringRef kSSLSessionConfig_standard()
public static CFStringRef kSSLSessionConfig_RC4_fallback()
public static CFStringRef kSSLSessionConfig_TLSv1_fallback()
public static CFStringRef kSSLSessionConfig_TLSv1_RC4_fallback()
public static CFStringRef kSSLSessionConfig_legacy()
public static CFStringRef kSSLSessionConfig_legacy_DHE()
public static CFStringRef kSSLSessionConfig_anonymous()
public static CFStringRef kSSLSessionConfig_3DES_fallback()
public static CFStringRef kSSLSessionConfig_TLSv1_3DES_fallback()
public static int SecCertificateCopyCommonName(SecCertificateRef certificate, org.moe.natj.general.ptr.Ptr<CFStringRef> commonName)
Retrieves the common name of the subject of a given certificate.
All the data in this string comes from the certificate itself, and thus it's in whatever language the certificate itself is in. Note that the certificate's common name field may not be present, or may be inadequate to describe the certificate; for display purposes, you should consider using SecCertificateCopySubjectSummary instead of this function.
certificate - A reference to the certificate from which to retrieve the common name.commonName - On return, a reference to the common name. Your code must release this reference by calling the CFRelease function.public static int SecCertificateCopyEmailAddresses(SecCertificateRef certificate, org.moe.natj.general.ptr.Ptr<CFArrayRef> emailAddresses)
Returns an array of zero or more email addresses for the subject of a given certificate.
certificate - A reference to the certificate from which to retrieve the email addresses.emailAddresses - On return, an array of zero or more CFStringRef elements corresponding to each email address found.
Your code must release this array reference by calling the CFRelease function.public static CFDataRef SecCertificateCopyNormalizedIssuerSequence(SecCertificateRef certificate)
Return the certificate's normalized issuer
The issuer is a sequence in the format used by SecItemCopyMatching. The content returned is a DER-encoded X.509 distinguished name. For a display version of the issuer, call SecCertificateCopyValues. The caller must CFRelease the value returned.
certificate - The certificate from which to get valuespublic static CFDataRef SecCertificateCopyNormalizedSubjectSequence(SecCertificateRef certificate)
Return the certificate's normalized subject
The subject is a sequence in the format used by SecItemCopyMatching. The content returned is a DER-encoded X.509 distinguished name. For a display version of the subject, call SecCertificateCopyValues. The caller must CFRelease the value returned.
certificate - The certificate from which to get valuespublic static SecKeyRef SecCertificateCopyPublicKey(SecCertificateRef certificate)
Retrieves the public key for a given certificate.
NOTE: Deprecated in iOS 12.0; use SecCertificateCopyKey instead for cross-platform availability.
certificate - A reference to the certificate from which to retrieve the public key.public static CFDataRef SecCertificateCopySerialNumberData(SecCertificateRef certificate, org.moe.natj.general.ptr.Ptr<CFErrorRef> error)
Return the certificate's serial number.
Return the content of a DER-encoded integer (without the tag and length fields) for this certificate's serial number. The caller must CFRelease the value returned.
certificate - The certificate from which to get values.error - An optional pointer to a CFErrorRef which will be set on return from the function if an error occurred. If not NULL, the caller is responsible for releasing the CFErrorRef.public static CFDataRef SecCertificateCopySerialNumber(SecCertificateRef certificate)
Return the certificate's serial number.
Return the content of a DER-encoded integer (without the tag and length fields) for this certificate's serial number. The caller must CFRelease the value returned. NOTE: Deprecated in iOS 11.0; use SecCertificateCopySerialNumberData instead for cross-platform availability.
certificate - The certificate from which to get values.public static int SSLSetSessionTicketsEnabled(SSLContextRef context, byte enabled)
Forcibly enable or disable session ticket resumption. [@note] By default, session tickets are disabled.
context - A valid SSLContextRef.enabled - Boolean indicating if ticket support is enabled (true) or not (false).public static int SSLSetALPNProtocols(SSLContextRef context, CFArrayRef protocols)
Set the ALPN protocols to be passed in the ALPN negotiation.
This is the list of supported application-layer protocols supported.
The protocols parameter must be an array of CFStringRef values with ASCII-encoded reprensetations of the supported protocols, e.g., "http/1.1".
[@note] See RFC 7301 for more information.
context - A valid SSLContextRef.protocols - Array of CFStringRefs carrying application protocols.public static int SSLCopyALPNProtocols(SSLContextRef context, org.moe.natj.general.ptr.Ptr<CFArrayRef> protocols)
Get the ALPN protocols associated with this SSL context.
This is the list of supported application-layer protocols supported.
The resultant protocols array will contain CFStringRef values containing ASCII-encoded representations of the supported protocols, e.g., "http/1.1".
See RFC 7301 for more information.
[@note] The `protocols` pointer must be NULL, otherwise the copy will fail. This function will allocate memory for the CFArrayRef container if there is data to provide. Otherwise, the pointer will remain NULL.
context - A valid SSLContextRef.protocols - Pointer to a CFArrayRef where peer ALPN protocols are stored.public static int SSLSetOCSPResponse(SSLContextRef context, CFDataRef response)
Set the OCSP response for the given SSL session.
The response parameter must be a non-NULL CFDataRef containing the bytes of the OCSP response.
context - A valid SSLContextRef.response - CFDataRef carrying OCSP response.public static int SSLSetError(SSLContextRef context, int status)
Set the status of a SSLContextRef.
This is to be done after handling steps of the SSL handshake such as server certificate validation.
context - A valid SSLContextRef.status - Error status to set internally, which will be translated to an alert.public static CFStringRef kSecAttrIsSensitive()
public static CFStringRef kSecAttrIsExtractable()
public static CFStringRef kSecAttrPersistantReference()
public static CFStringRef kSecAttrPersistentReference()
public static CFStringRef kSecKeyAlgorithmRSASignatureDigestPSSSHA1()
public static CFStringRef kSecKeyAlgorithmRSASignatureDigestPSSSHA224()
public static CFStringRef kSecKeyAlgorithmRSASignatureDigestPSSSHA256()
public static CFStringRef kSecKeyAlgorithmRSASignatureDigestPSSSHA384()
public static CFStringRef kSecKeyAlgorithmRSASignatureDigestPSSSHA512()
public static CFStringRef kSecKeyAlgorithmRSASignatureMessagePSSSHA1()
public static CFStringRef kSecKeyAlgorithmRSASignatureMessagePSSSHA224()
public static CFStringRef kSecKeyAlgorithmRSASignatureMessagePSSSHA256()
public static CFStringRef kSecKeyAlgorithmRSASignatureMessagePSSSHA384()
public static CFStringRef kSecKeyAlgorithmRSASignatureMessagePSSSHA512()
public static CFStringRef kSecKeyAlgorithmECIESEncryptionStandardVariableIVX963SHA224AESGCM()
public static CFStringRef kSecKeyAlgorithmECIESEncryptionStandardVariableIVX963SHA256AESGCM()
public static CFStringRef kSecKeyAlgorithmECIESEncryptionStandardVariableIVX963SHA384AESGCM()
public static CFStringRef kSecKeyAlgorithmECIESEncryptionStandardVariableIVX963SHA512AESGCM()
public static CFStringRef kSecKeyAlgorithmECIESEncryptionCofactorVariableIVX963SHA224AESGCM()
public static CFStringRef kSecKeyAlgorithmECIESEncryptionCofactorVariableIVX963SHA256AESGCM()
public static CFStringRef kSecKeyAlgorithmECIESEncryptionCofactorVariableIVX963SHA384AESGCM()
public static CFStringRef kSecKeyAlgorithmECIESEncryptionCofactorVariableIVX963SHA512AESGCM()
public static CFStringRef SecCopyErrorMessageString(int status, org.moe.natj.general.ptr.VoidPtr reserved)
Returns a string describing the specified error result code. [@reserved] Reserved for future use. Your code should pass NULL in this parameter.
status - An error result code of type OSStatus or CSSM_RETURN, as returned by a Security or CSSM function.public static SecKeyRef SecCertificateCopyKey(SecCertificateRef certificate)
Retrieves the public key for a given certificate.
RSA and ECDSA public keys are supported. All other public key algorithms are unsupported.
certificate - A reference to the certificate from which to retrieve the public key.public static boolean SecTrustEvaluateWithError(SecTrustRef trust, org.moe.natj.general.ptr.Ptr<CFErrorRef> error)
Evaluates a trust reference synchronously.
This function will completely evaluate trust before returning, possibly including network access to fetch intermediate certificates or to perform revocation checking. Since this function can block during those operations, you should call it from within a function that is placed on a dispatch queue, or in a separate thread from your application's main run loop. If the certificate is trusted and the result is true, the error will be set to NULL. If the certificate is not trusted or the evaluation was unable to complete, the result will be false and the error will be set with a description of the failure. The error contains a code for the most serious error encountered (if multiple trust failures occurred). The localized description indicates the certificate with the most serious problem and the type of error. The underlying error contains a localized description of each certificate in the chain that had an error and all errors found with that certificate.
trust - A reference to the trust object to evaluate.error - A pointer to an error objectpublic static int SecTrustEvaluateAsyncWithError(SecTrustRef trust, NSObject queue, Security.Block_SecTrustEvaluateAsyncWithError result)
Evaluates a trust reference asynchronously.
If the certificate is trusted, the callback will return a result parameter of true and the error will be set to NULL. If the certificate is not trusted or the evaluation was unable to complete, the result parameter will be false and the error will be set with a description of the failure. The error contains a code for the most serious error encountered (if multiple trust failures occurred). The localized description indicates the certificate with the most serious problem and the type of error. The underlying error contains a localized description of each certificate in the chain that had an error and all errors found with that certificate.
trust - A reference to the trust object to evaluate.queue - A dispatch queue on which the result callback will be executed. Note that this
function MUST be called from that queue.result - A SecTrustWithErrorCallback block which will be executed when the trust evaluation
is complete.
The block is guaranteed to be called exactly once when the result code is errSecSuccess, and not
called otherwise. Note that this block may be called synchronously inline if no asynchronous
operations are required.public static int SecTrustSetSignedCertificateTimestamps(SecTrustRef trust, CFArrayRef sctArray)
Attach SignedCertificateTimestamp data to a trust object.
Allows the caller to provide SCT data (which may be obtained during a TLS/SSL handshake, per RFC 6962) as input to a trust evaluation.
trust - A reference to a trust object.sctArray - is a CFArray of CFData objects each containing a SCT (per RFC 6962).public static NSObject sec_trust_create(SecTrustRef trust)
Create an ARC-able `sec_trust_t` instance from a `SecTrustRef`.
trust - A `SecTrustRef` instance.public static SecTrustRef sec_trust_copy_ref(NSObject trust)
Copy a retained reference to the underlying `SecTrustRef` instance.
trust - A `sec_trust_t` instance.public static NSObject sec_identity_create(SecIdentityRef identity)
Create an ARC-able `sec_identity_t` instance from a `SecIdentityRef`.
identity - A `SecIdentityRef` instance.public static NSObject sec_identity_create_with_certificates(SecIdentityRef identity, CFArrayRef certificates)
Create an ARC-able `sec_identity_t` instance from a `SecIdentityRef` and array of SecCertificateRef instances.
identity - A `SecIdentityRef` instance.certificates - An array of `SecCertificateRef` instances.public static boolean sec_identity_access_certificates(NSObject identity, Security.Block_sec_identity_access_certificates handler)
Access the certificates associated with the `sec_identity_t` instance.
identity - A `sec_identity_t` instance.handler - A block to invoke one or more times with `sec_certificate_t` instances.public static SecIdentityRef sec_identity_copy_ref(NSObject identity)
Copy a retained reference to the underlying `SecIdentityRef` instance.
identity - A `sec_identity_t` instance.public static CFArrayRef sec_identity_copy_certificates_ref(NSObject identity)
Copy a retained reference to the underlying `CFArrayRef` container of `SecCertificateRef` types.
identity - A `sec_identity_t` instance.public static NSObject sec_certificate_create(SecCertificateRef certificate)
Create an ARC-able `sec_certificate_t` instance from a `SecCertificateRef`.
certificate - A `SecCertificateRef` instance.public static SecCertificateRef sec_certificate_copy_ref(NSObject certificate)
Copy a retained reference to the underlying `SecCertificateRef` instance.
certificate - A `sec_certificate_t` instance.public static java.lang.String sec_protocol_metadata_get_negotiated_protocol(NSObject metadata)
Get the application protocol negotiated, e.g., via the TLS ALPN extension.
metadata - A `sec_protocol_metadata_t` instance.public static NSObject sec_protocol_metadata_copy_peer_public_key(NSObject metadata)
Get the protocol instance peer's public key.
metadata - A `sec_protocol_metadata_t` instance.public static short sec_protocol_metadata_get_negotiated_tls_protocol_version(NSObject metadata)
Get the negotiated TLS version.
metadata - A `sec_protocol_metadata_t` instance.public static int sec_protocol_metadata_get_negotiated_protocol_version(NSObject metadata)
Get the negotiated TLS version.
metadata - A `sec_protocol_metadata_t` instance.public static short sec_protocol_metadata_get_negotiated_tls_ciphersuite(NSObject metadata)
Get the negotiated TLS ciphersuite.
metadata - A `sec_protocol_metadata_t` instance.public static char sec_protocol_metadata_get_negotiated_ciphersuite(NSObject metadata)
Get the negotiated TLS ciphersuite.
metadata - A `sec_protocol_metadata_t` instance.public static boolean sec_protocol_metadata_get_early_data_accepted(NSObject metadata)
Determine if early data was accepted by the peer.
metadata - A `sec_protocol_metadata_t` instance.public static boolean sec_protocol_metadata_access_peer_certificate_chain(NSObject metadata, Security.Block_sec_protocol_metadata_access_peer_certificate_chain handler)
Get the certificate chain of the protocol instance peer.
metadata - A `sec_protocol_metadata_t` instance.handler - A block to invoke one or more times with sec_certificate_t objectspublic static boolean sec_protocol_metadata_access_ocsp_response(NSObject metadata, Security.Block_sec_protocol_metadata_access_ocsp_response handler)
Get the OCSP response from the protocol instance peer.
metadata - A `sec_protocol_metadata_t` instance.handler - A block to invoke one or more times with OCSP datapublic static boolean sec_protocol_metadata_access_supported_signature_algorithms(NSObject metadata, Security.Block_sec_protocol_metadata_access_supported_signature_algorithms handler)
Get the signature algorithms supported by the peer. Clients may call this in response to a challenge block.
metadata - A `sec_protocol_metadata_t` instance.handler - A block to invoke one or more times with OCSP datapublic static boolean sec_protocol_metadata_access_distinguished_names(NSObject metadata, Security.Block_sec_protocol_metadata_access_distinguished_names handler)
Get the X.509 Distinguished Names from the protocol instance peer.
metadata - A `sec_protocol_metadata_t` instance.handler - A block to invoke one or more times with distinguished_name datapublic static boolean sec_protocol_metadata_access_pre_shared_keys(NSObject metadata, Security.Block_sec_protocol_metadata_access_pre_shared_keys handler)
Get the PSKs supported by the local instance.
metadata - A `sec_protocol_metadata_t` instance.handler - A block to invoke one or more times with tuples of dispatch_data_t objects carrying PSKs and their corresponding identities.public static java.lang.String sec_protocol_metadata_get_server_name(NSObject metadata)
Obtain the server name offered by a client or server during connection establishmet. This is the value commonly carried in the TLS SNI extesion.
metadata - A `sec_protocol_metadata_t` instance.public static boolean sec_protocol_metadata_peers_are_equal(NSObject metadataA, NSObject metadataB)
Compare peer information for two `sec_protocol_metadata` instances. This comparison does not include protocol configuration options, e.g., ciphersuites.
metadataA - A `sec_protocol_metadata_t` instance.metadataB - A `sec_protocol_metadata_t` instance.public static boolean sec_protocol_metadata_challenge_parameters_are_equal(NSObject metadataA, NSObject metadataB)
Compare challenge-relevant information for two `sec_protocol_metadata` instances.
This comparison includes all information relevant to a challenge request, including: distinguished names, signature algorithms, and supported certificate types. See Section 7.4.4 of RFC5246 for more details.
metadataA - A `sec_protocol_metadata_t` instance.metadataB - A `sec_protocol_metadata_t` instance.public static NSObject sec_protocol_metadata_create_secret(NSObject metadata, long label_len, java.lang.String label, long exporter_length)
Export a secret, e.g., a cryptographic key, derived from the protocol metadata using a label string.
metadata - A `sec_protocol_metadata_t` instance.label_len - Length of the KDF label string.label - KDF label string.exporter_length - Length of the secret to be exported.public static NSObject sec_protocol_metadata_create_secret_with_context(NSObject metadata, long label_len, java.lang.String label, long context_len, java.lang.String context, long exporter_length)
Export a secret, e.g., a cryptographic key, derived from the protocol metadata using a label and context string.
metadata - A `sec_protocol_metadata_t` instance.label_len - Length of the KDF label string.label - KDF label string.context_len - Length of the KDF context string.context - Constant opaque context valueexporter_length - Length of the secret to be exported.public static boolean sec_protocol_options_are_equal(NSObject optionsA, NSObject optionsB)
Compare two `sec_protocol_options_t` instances.
optionsA - A `sec_protocol_options_t` instance.optionsB - A `sec_protocol_options_t` instance.public static void sec_protocol_options_set_local_identity(NSObject options, NSObject identity)
Set the local identity to be used for this protocol instance.
options - A `sec_protocol_options_t` instance.identity - A `sec_identity_t` instance carrying the private key and certificate.public static void sec_protocol_options_append_tls_ciphersuite(NSObject options, short ciphersuite)
Append a TLS ciphersuite to the set of enabled ciphersuites.
options - A `sec_protocol_options_t` instance.ciphersuite - A `tls_ciphersuite_t` value.public static void sec_protocol_options_add_tls_ciphersuite(NSObject options, char ciphersuite)
Add a TLS ciphersuite to the set of enabled ciphersuites.
options - A `sec_protocol_options_t` instance.ciphersuite - A SSLCipherSuite value.public static void sec_protocol_options_append_tls_ciphersuite_group(NSObject options, short group)
Append a TLS ciphersuite group to the set of enabled ciphersuites.
options - A `sec_protocol_options_t` instance.group - A SSLCipherSuiteGroup value.public static void sec_protocol_options_add_tls_ciphersuite_group(NSObject options, int group)
Add a TLS ciphersuite group to the set of enabled ciphersuites.
options - A `sec_protocol_options_t` instance.group - A SSLCipherSuiteGroup value.public static void sec_protocol_options_set_tls_min_version(NSObject options, int version)
Set the minimum support TLS version.
options - A `sec_protocol_options_t` instance.version - A SSLProtocol enum value.public static void sec_protocol_options_set_min_tls_protocol_version(NSObject options, short version)
Set the minimum support TLS version.
options - A `sec_protocol_options_t` instance.version - A tls_protocol_version_t enum value.public static short sec_protocol_options_get_default_min_tls_protocol_version()
Get the system default minimum TLS protocol version.
public static short sec_protocol_options_get_default_min_dtls_protocol_version()
Get the system default minimum DTLS protocol version.
public static void sec_protocol_options_set_tls_max_version(NSObject options, int version)
Set the maximum support TLS version.
options - A `sec_protocol_options_t` instance.version - A SSLProtocol enum value.public static void sec_protocol_options_set_max_tls_protocol_version(NSObject options, short version)
Set the maximum support TLS version.
options - A `sec_protocol_options_t` instance.version - A tls_protocol_version_t enum value.public static short sec_protocol_options_get_default_max_tls_protocol_version()
Get the system default maximum TLS protocol version.
public static short sec_protocol_options_get_default_max_dtls_protocol_version()
Get the system default maximum DTLS protocol version.
public static void sec_protocol_options_add_tls_application_protocol(NSObject options, java.lang.String application_protocol)
Add an application protocol supported by clients of this protocol instance.
options - A `sec_protocol_options_t` instance.application_protocol - A NULL-terminated string defining the application protocol.public static void sec_protocol_options_set_tls_server_name(NSObject options, java.lang.String server_name)
Set the server name to be used when verifying the peer's certificate. This will override the server name obtained from the endpoint.
options - A `sec_protocol_options_t` instance.server_name - A NULL-terminated string carrying the server name.public static void sec_protocol_options_set_tls_diffie_hellman_parameters(NSObject options, NSObject params)
Set the supported Diffie-Hellman parameters.
options - A `sec_protocol_options_t` instance.params - A dispatch_data_t containing legacy Diffie-Hellman parameters.public static void sec_protocol_options_add_pre_shared_key(NSObject options, NSObject psk, NSObject psk_identity)
Add a pre-shared key (PSK) and its identity to the options.
options - A `sec_protocol_options_t` instance.psk - A dispatch_data_t containing a PSK blob.psk_identity - A dispatch_data_t containing a PSK identity blob.public static void sec_protocol_options_set_tls_pre_shared_key_identity_hint(NSObject options, NSObject psk_identity_hint)
Set the PSK identity hint to use by servers when negotiating a PSK ciphersuite. See https://tools.ietf.org/html/rfc4279 for more details.
options - A `sec_protocol_options_t` instance.psk_identity_hint - A dispatch_data_t containing a PSK identity hint.public static void sec_protocol_options_set_tls_tickets_enabled(NSObject options, boolean tickets_enabled)
Enable or disable TLS session ticket support.
options - A `sec_protocol_options_t` instance.tickets_enabled - Flag to enable or disable TLS session ticket support.public static void sec_protocol_options_set_tls_is_fallback_attempt(NSObject options, boolean is_fallback_attempt)
Signal if this is a TLS fallback attempt.
A fallback attempt is one following a previously failed TLS connection due to version or parameter incompatibility, e.g., when speaking to a server that does not support a client-offered ciphersuite.
Clients MUST NOT enable fallback for fresh connections.
options - A `sec_protocol_options_t` instance.is_fallback_attempt - Set a flag indicating that this is a TLS fallback attempt.public static void sec_protocol_options_set_tls_resumption_enabled(NSObject options, boolean resumption_enabled)
Enable or disable TLS session resumption.
options - A `sec_protocol_options_t` instance.resumption_enabled - Flag to enable or disable TLS session resumption.public static void sec_protocol_options_set_tls_false_start_enabled(NSObject options, boolean false_start_enabled)
Enable or disable TLS False Start.
options - A `sec_protocol_options_t` instance.false_start_enabled - Flag to enable or disable TLS False Start.public static void sec_protocol_options_set_tls_ocsp_enabled(NSObject options, boolean ocsp_enabled)
Enable or disable OCSP support.
options - A `sec_protocol_options_t` instance.ocsp_enabled - Flag to enable or disable OCSP support.public static void sec_protocol_options_set_tls_sct_enabled(NSObject options, boolean sct_enabled)
Enable or disable SCT (signed certificate timestamp) support.
options - A `sec_protocol_options_t` instance.sct_enabled - Flag to enable or disable SCT support.public static void sec_protocol_options_set_tls_renegotiation_enabled(NSObject options, boolean renegotiation_enabled)
Enable or disable TLS (1.2 and prior) session renegotiation. This defaults to `true`.
options - A `sec_protocol_options_t` instance.renegotiation_enabled - Flag to enable or disable TLS (1.2 and prior) session renegotiation.public static void sec_protocol_options_set_peer_authentication_required(NSObject options, boolean peer_authentication_required)
Enable or disable peer authentication. Clients default to true, whereas servers default to false.
options - A `sec_protocol_options_t` instance.peer_authentication_required - Flag to enable or disable mandatory peer authentication.public static CFStringRef kSecUseDataProtectionKeychain()
public static void sec_protocol_options_set_pre_shared_key_selection_block(NSObject options, Security.Block_sec_protocol_options_set_pre_shared_key_selection_block psk_selection_block, NSObject psk_selection_queue)
Set the PSK selection block.
[@params] psk_selection_queue A `dispatch_queue_t` on which the PSK selection block should be called.
options - A `sec_protocol_options_t` instance.psk_selection_block - A `sec_protocol_pre_shared_key_selection_t` block.public static void sec_protocol_options_set_key_update_block(NSObject options, Security.Block_sec_protocol_options_set_key_update_block key_update_block, NSObject key_update_queue)
Set the key update block.
[@params] key_update_queue A `dispatch_queue_t` on which the key update block should be called.
options - A `sec_protocol_options_t` instance.key_update_block - A `sec_protocol_key_update_t` block.public static void sec_protocol_options_set_challenge_block(NSObject options, Security.Block_sec_protocol_options_set_challenge_block challenge_block, NSObject challenge_queue)
Set the challenge block.
[@params] challenge_block A `sec_protocol_challenge_t` block.
[@params] challenge_queue A `dispatch_queue_t` on which the challenge block should be called.
options - A `sec_protocol_options_t` instance.public static void sec_protocol_options_set_verify_block(NSObject options, Security.Block_sec_protocol_options_set_verify_block verify_block, NSObject verify_block_queue)
Set the verify block.
[@params] verify_block A `sec_protocol_verify_t` block.
[@params] verify_block_queue A `dispatch_queue_t` on which the verify block should be called.
options - A `sec_protocol_options_t` instance.public static SecKeyRef SecTrustCopyKey(SecTrustRef trust)
Return the public key for a leaf certificate after it has been evaluated.
RSA and ECDSA public keys are supported. All other public key algorithms are unsupported.
trust - A reference to the trust object which has been evaluated.public static CFArrayRef SecTrustCopyCertificateChain(SecTrustRef trust)
Returns the certificate trust chain
trust - Reference to a trust object.