secIdentity

fun CertificateStore.secIdentity(alias: String): SecIdentityRef?(source)

Returns the keychain identity stored under alias, for use with URLSession client authentication or SecIdentityCopyPrivateKey. The reference is retained: release it with CFRelease when done.

Return

the identity, or null if alias has no entry or holds only a certificate.

Throws

if alias is blank or contains NUL, CR, or LF, or this store was not created by CertificateStore.forCurrentPlatform.