public static Credentials parse ( final String encoded ) { try { final String decoded = new String ( Base64 . getDecoder ( ) . decode ( encoded ) , UTF_8 ) ; final String [ ] parts = decoded . split ( ":" , 2 ) ; if ( parts . length == 2 ) { return new Credentials ( parts [ 0 ] , parts [ 1 ] ) ; } } catch ( final IllegalArgumentException ex ) { // log error } return null ; }
Create a set of credentials .