importPkcs12

abstract fun importPkcs12(alias: String, pkcs12: ByteArray, passphrase: CharArray): CertificateInfo(source)

Imports the single identity in pkcs12 under alias, replacing any existing entry.

passphrase is read but not cleared; callers own and should clear it.

Return

the imported entry, with CertificateInfo.hasPrivateKey set.

Throws

if the backend is unavailable or the import fails; reason Unsupported if the bundle exceeds what the platform can store.

if alias is invalid, pkcs12 is empty, larger than 1 MiB, malformed, protected by a different passphrase, or does not contain exactly one private key with its certificate chain.