Interface PublicKeySource


  • public interface PublicKeySource

    Implementations of this interface represent a source of an ECPublicKey.

    A PublicKeySource validates the extracted public key depending on its implementation.

    Typically, to create a PublicKeySource, a factory method defined in PublicKeySources is used.

    Thread Safety:

    Depends on implementations. Typically, an implementation of this interface is not thread-safe.

    Author:
    Tomoki Sato
    See Also:
    PrivateKeySource, PublicKeySources
    • Method Detail

      • extract

        ECPublicKey extract()
        Extracts the ECPublicKey from the source represented by this object.
        Returns:
        the elliptic curve (EC) public key.
        Throws:
        InvalidECPublicKeyException - if the extracted public key is invalid(Depending on the implementation).
      • extractBytesInUncompressedForm

        byte[] extractBytesInUncompressedForm()
        Extracts the octet sequence of the elliptic curve (EC) public key in uncompressed form.
        Returns:
        the octet sequence of the public key in uncompressed form.
        Throws:
        InvalidECPublicKeyException - if the extracted public key is invalid(Depending on the implementation).
      • extractStringInUncompressedForm

        default String extractStringInUncompressedForm()
        Extracts the elliptic curve (EC) public key in uncompressed form encoded using base64url without padding.
        Returns:
        the public key in uncompressed form encoded using base64url without padding.
        Throws:
        InvalidECPublicKeyException - if the extracted public key is invalid(Depending on the implementation).