Class X25519Conscrypt

  • All Implemented Interfaces:
    X25519

    @Immutable
    public final class X25519Conscrypt
    extends java.lang.Object
    implements X25519
    X25519 implementation using Conscrypt.

    We use the PKCS8 and X509 encodings of the private and the public keys, because they are supported by all JCE implementations and they are easier to convert from and to their raw 32-byte encodings.

    • Method Detail

      • create

        public static X25519 create()
                             throws java.security.GeneralSecurityException
        Throws:
        java.security.GeneralSecurityException
      • generateKeyPair

        public X25519.KeyPair generateKeyPair()
                                       throws java.security.GeneralSecurityException
        Description copied from interface: X25519
        generateKeyPair.
        Specified by:
        generateKeyPair in interface X25519
        Throws:
        java.security.GeneralSecurityException
      • computeSharedSecret

        public byte[] computeSharedSecret​(byte[] privateValue,
                                          byte[] peersPublicValue)
                                   throws java.security.GeneralSecurityException
        Description copied from interface: X25519
        computeSharedSecret.
        Specified by:
        computeSharedSecret in interface X25519
        Throws:
        java.security.GeneralSecurityException