Class ECKeyConverter

    • Field Detail

      • PUBLIC_EC_KEY_START

        public static final java.lang.String PUBLIC_EC_KEY_START
        the public EC key start
        See Also:
        Constant Field Values
      • PUBLIC_EC_KEY_END

        public static final java.lang.String PUBLIC_EC_KEY_END
        the public EC key end
        See Also:
        Constant Field Values
      • PRIVATE_EC_KEY_START

        public static final java.lang.String PRIVATE_EC_KEY_START
        the private ECA key certificate start
        See Also:
        Constant Field Values
      • PRIVATE_EC_KEY_END

        public static final java.lang.String PRIVATE_EC_KEY_END
        the private EC key certificate end
        See Also:
        Constant Field Values
    • Constructor Detail

      • ECKeyConverter

        public ECKeyConverter()
        Constructor for ECConverter
      • ECKeyConverter

        public ECKeyConverter​(java.lang.String provider)
        Constructor for ECConverter
        Parameters:
        provider - the provider or null to use default provider
    • Method Detail

      • getPublicKey

        public java.security.PublicKey getPublicKey​(byte[] content)
                                             throws java.io.IOException,
                                                    java.security.GeneralSecurityException
        Description copied from interface: IKeyConverter
        Reads PKCS#8 formated public key from a buffer, which are each bounded at the beginning by -----BEGIN ... PUBLIC KEY-----, and bounded at the end by -----END ... PUBLIC KEY-----.
        Parameters:
        content - the data
        Returns:
        the public key
        Throws:
        java.io.IOException - in case of error
        java.security.GeneralSecurityException - in case of error
        See Also:
        IKeyConverter.getPublicKey(byte[])
      • formatPublicKey

        public java.lang.String formatPublicKey​(java.security.PublicKey publicKey)
        Description copied from interface: IKeyConverter
        Formats a public key into a well formated X509 certificate (PEM format), which are each bounded at the beginning by -----BEGIN ... PUBLIC KEY-----, and bounded at the end by -----END ... PUBLIC KEY-----.
        Parameters:
        publicKey - the public key to format
        Returns:
        the well formed certificate
        See Also:
        IKeyConverter.formatPublicKey(java.security.PublicKey)
      • formatPKCS8

        public java.lang.String formatPKCS8​(java.lang.String content)
        Description copied from interface: IKeyConverter
        Formats a raw base64 encoded PKCS8 to a well formed private key, which is bounded at the beginning by -----BEGIN ... PRIVATE KEY-----, and bounded at the end by -----END ... PRIVATE KEY-----.
        Parameters:
        content - the raw data to format
        Returns:
        the well formed certificate
        See Also:
        IKeyConverter.formatPKCS8(java.lang.String)
      • normalizePKCS8

        public java.lang.String normalizePKCS8​(java.lang.String content)
        Description copied from interface: IKeyConverter
        Normalise a raw base64 encoded PKCS8 to a well formed private key.
        Parameters:
        content - the raw data to normalise
        Returns:
        the normalised private key
        See Also:
        IKeyConverter.normalizePKCS8(java.lang.String)