EVP_parse_public_key function
EVP_parse_public_key decodes a DER-encoded SubjectPublicKeyInfo structure (RFC 5280) from |cbs| and advances |cbs|. It returns a newly-allocated |EVP_PKEY| or NULL on error.
Prefer |EVP_PKEY_from_subject_public_key_info| instead. This function has several pitfalls:
Callers are expected to handle trailing data returned from |cbs|, making more common cases error-prone.
There is also no way to pass in supported algorithms. This function instead supports some default set of algorithms. Future versions of BoringSSL may add to this list, based on the needs of the other callers. Conversely, some algorithms may be intentionally omitted, if they cause too much risk to existing callers.
This means callers must check the type of the parsed public key to ensure it is suitable and validate other desired key properties such as RSA modulus size or EC curve.
Implementation
@meta.RecordUse()
@ffi.Native<ffi.Pointer<EVP_PKEY> Function(ffi.Pointer<CBS>)>(
symbol: 'bssl_dart_EVP_parse_public_key',
)
external ffi.Pointer<EVP_PKEY> EVP_parse_public_key(
ffi.Pointer<CBS> cbs,
);