public String encryptPassword ( String plain ) { Preconditions . checkArgument ( this . encryptors . size ( ) > 0 , "A master password needs to be provided for encrypting passwords." ) ; try { return this . encryptors . get ( 0 ) . encrypt ( plain ) ; } catch ( Exception e ) { throw new RuntimeException ( "Failed to encrypt password" , e ) ; } }
Encrypt a password . A master password must have been provided in the constructor .