/** * return a hash of a given secret if any. * * @param secret * @return */ public String hash(String secret) { return Codecs.encodeBase64( Digests.sha2(settings.cryptoHashSalt(), Codecs.toBytes(secret)), false); }
/** @param settings */ public CredentialsCrypto(AccountSettings settings) { this.settings = settings; this.keyHash = Digests.sha2(Codecs.toBytes(settings.cryptoKeySeed())); }