I understand that Java and Android could share the same code so I create a single ticket.
Certificate API: https://github.com/couchbase/couchbase-lite-core/blob/master/Crypto/Certificate.hh#L186-L189 (See https://github.com/couchbase/couchbase-lite-core/pull/959 for potential update)
Apple Implementation: https://github.com/couchbase/couchbase-lite-core/blob/master/Crypto/PublicKey%2BApple.mm
Some related pending PRs for Apple:
As Java/Android will require to call back to the Java's KeyStore to generate keys and save/load/delete the keys and certificate, we might need an abstract object representing the KeyStore to be passed from JNI code to the native code.