extractPublicKey from NIOSSLCertificate

I have a Swift package that uses NIOSSL, version 2.23.0. If I got into .build/checkouts/swift-nio-ssl/Sources directory and look into the file NIOSSL/SSLCertificate.swift I see:

extension NIOSSLCertificate {
  ...
  public func extractPublicKey() throws -> NIOSSLPublicKey {
     ...

However, when I try to call it from this code,

let ssl_handler = NIOSSLServerHandler(context: sslContext,
  customVerificationCallback: { cert, promise in
    let public_key = cert.extractPublicKey()
    print("cert: ", public_key)
    promise.succeed(.certificateVerified)
  }
)

I get this compile error,

error: value of type '[NIOSSLCertificate]' has no member 'extractPublicKey'
          let public_key = cert.extractPublicKey()

I found the problem. The value is an array of certificates. The solution is:

    let public_key = cert[0].extractPublicKey()
extractPublicKey from NIOSSLCertificate
 
 
Q