Interface Sign.Lazy

    • Method Detail

      • cryptoSignSeedKeypair

        KeyPair cryptoSignSeedKeypair​(byte[] seed)
                               throws SodiumException
        Generate a signing keypair deterministically.
        Parameters:
        seed - The seed to generate keys.
        Returns:
        Public and private keypair.
        Throws:
        SodiumException
      • cryptoSignSecretKeyPair

        KeyPair cryptoSignSecretKeyPair​(Key secretKey)
                                 throws SodiumException
        Generate a signing keypair (ed25519), given a secret ed25519 key.
        Parameters:
        secretKey - The ed25519 secret key.
        Returns:
        The private and public ed25519 keys.
        Throws:
        SodiumException
      • cryptoSignOpen

        java.lang.String cryptoSignOpen​(java.lang.String signedMessage,
                                        Key publicKey)
        Checks that a message is validly signed by a public key.
        Parameters:
        signedMessage - The signed message.
        publicKey - The public key that signed the message.
        Returns:
        Returns the message without a signature. If null, then the message is not validly signed by the publicKey.
      • cryptoSignDetached

        java.lang.String cryptoSignDetached​(java.lang.String message,
                                            Key secretKey)
                                     throws SodiumException
        Returns a signature for a message. This does not prepend the signature to the message. See cryptoSign(String, String) for that.
        Parameters:
        message - The message to sign.
        secretKey - The secret key.
        Returns:
        The signature for a message.
        Throws:
        SodiumException - If could not sign.
      • cryptoSignVerifyDetached

        boolean cryptoSignVerifyDetached​(java.lang.String signature,
                                         java.lang.String message,
                                         Key publicKey)
        Verifies that signature is valid for the message.
        Parameters:
        signature - The signature.
        message - The message.
        publicKey - The public key that signed the message.
        Returns:
        Returns true if the signature is valid for the message.
        See Also:
        cryptoSignDetached(String, Key)
      • convertKeyPairEd25519ToCurve25519

        KeyPair convertKeyPairEd25519ToCurve25519​(KeyPair ed25519KeyPair)
                                           throws SodiumException
        Converts a ed25519 keypair to a curve25519 keypair.
        Parameters:
        ed25519KeyPair - The key pair.
        Returns:
        curve25519KeyPair
        Throws:
        SodiumException - If conversion was unsuccessful.