Class KeyPairUtil


  • public final class KeyPairUtil
    extends Object
    • Method Detail

      • getEncodedKeyIdentifier

        public static String getEncodedKeyIdentifier​(PublicKey key)
        Get Base64 encoded public key as string. Primarily for generating filenames and transferring public keys across the wire. Strips the trailing '=' characters, which some decoders may not like!
      • getAsciiHexEncodedPublicKeyHash

        public static String getAsciiHexEncodedPublicKeyHash​(PublicKey publicKey)
        Get ASCII Hex encoded hash of the public key; for use in certificate subjects as described here: https://datatracker.ietf.org/doc/html/rfc6487#section-8
      • getKeyIdentifier

        public static byte[] getKeyIdentifier​(PublicKey key)
      • base64UrlEncode

        public static String base64UrlEncode​(byte[] data)