public SecretBox(byte[] seed) { checkLength(seed, SEED_LENGTH); this.seed = seed; this.secretKey = CryptoUtils.zeros(SECRETKEY_BYTES * 2); byte[] publicKey = CryptoUtils.zeros(PUBLICKEY_BYTES); isValid( sodium().crypto_sign_ed25519_seed_keypair(publicKey, secretKey, seed), "Failed to generate a key pair"); this.pubKey = Base58.encode(publicKey); }
/** * Return the secret key, encode in Base58 * * @return */ public String getSecretKey() { return Base58.encode(secretKey); }