agave-common/common-legacy-api/src/main/java/org/iplantc/service/common/auth/ProxyUserGuard.java
/**
     * Decrypts a token using the given public key.
     * 
     * @param publicKey the public key.
     * @param token the token to decrypt.
     * @return the decrypted token as a string.
     * @throws GeneralSecurityException if the public key uses an unsupported algorithm.
     */
Decrypts a token using the given public key.

@param publicKey the public key.
@param token the token to decrypt.
@return the decrypted token as a string.
@throws GeneralSecurityException if the public key uses an unsupported algorithm.
Decrypts a token using the given public key . @param publicKey the public key . @param token the token to decrypt . @return the decrypted token as a string . @throws GeneralSecurityException if the public key uses an unsupported algorithm .
private String decryptToken(PublicKey publicKey, char[] token) throws GeneralSecurityException {
        Cipher cipher = Cipher.getInstance(publicKey.getAlgorithm());
        cipher.init(Cipher.DECRYPT_MODE, publicKey);
        byte[] decrypted = null;
        try {
            LOG.warn("Encrypted Token Length: " + Base64.decode(new String(token)).length);
            decrypted = cipher.doFinal(Base64.decode(new String(token)));
        }
        catch (GeneralSecurityException e) {
            return null;
        }
        return stringFromBytes(decrypted);
    }
private String decryptToken ( PublicKey publicKey , char [ ] token ) throws GeneralSecurityException { Cipher cipher = Cipher . getInstance ( publicKey . getAlgorithm ( ) ) ; cipher . init ( Cipher . DECRYPT_MODE , publicKey ) ; byte [ ] decrypted = null ; try { LOG . warn ( "Encrypted Token Length: " + Base64 . decode ( new String ( token ) ) . length ) ; decrypted = cipher . doFinal ( Base64 . decode ( new String ( token ) ) ) ; } catch ( GeneralSecurityException e ) { return null ; } return stringFromBytes ( decrypted ) ; }
Decrypts a token using the given public key.
Decrypts a token using the given public key .