BoringSSL can give us a pointer to an OID which is part of a larger allocation that can not separately be deallocated. This is the case for Certificate Extensions where each extension has an OID but the memory of this OID is actually owned by the certificate.
Modification
add support for specifying an owner of the memory which we need to retain to keep the memory alive
add support for copying the memory and taking ownership of that copy
Result
We can vend users a NIOSSLObjectIdentifier for e.g. a Certificate Extension OID without needing to do a copy first.
Motivation
BoringSSL can give us a pointer to an OID which is part of a larger allocation that can not separately be deallocated. This is the case for Certificate Extensions where each extension has an OID but the memory of this OID is actually owned by the certificate.
Modification
Result
We can vend users a
NIOSSLObjectIdentifier
for e.g. a Certificate Extension OID without needing to do a copy first.