Example usage for javax.xml.bind DatatypeConverter parseBase64Binary

List of usage examples for javax.xml.bind DatatypeConverter parseBase64Binary

Introduction

In this page you can find the example usage for javax.xml.bind DatatypeConverter parseBase64Binary.

Prototype

public static byte[] parseBase64Binary(String lexicalXSDBase64Binary) 

Source Link

Document

Converts the string argument into an array of bytes.

Usage

From source file:com._8x8.data.repository.EncryptorRepository.java

@Override
public String decrypt(String encryptedData) throws Exception {
    String decoded = new String(DatatypeConverter.parseBase64Binary(encryptedData));
    return decoded;
}

From source file:be.solidx.hot.utils.SSLUtils.java

public static PrivateKey toPrivateKey(InputStream pemInputStream)
        throws IOException, InvalidKeySpecException, NoSuchAlgorithmException {
    String data = IOUtils.toString(pemInputStream);
    String[] tokens = data.split(PEM_KEY_BEGIN_DELIMITER);
    tokens = tokens[1].trim().split(PEM_KEY_END_DELIMITER);
    return generatePrivateKeyFromDER(DatatypeConverter.parseBase64Binary(tokens[0]));
}

From source file:com._8x8.logic.service.EncryptorService.java

@Override
public String decryptCode(String encrypted) throws Exception {
    //String decryptTxt = _encryptorRepository.decrypt(encrypted);
    // add more secure decrypt logic
    //return decryptTxt;

    String decoded = new String(DatatypeConverter.parseBase64Binary(encrypted));
    return decoded;
}

From source file:com.microsoftopentechnologies.auth.jwt.JWTParser.java

private static String stringFromBase64(String str) {
    return new String(DatatypeConverter.parseBase64Binary(normalizeB64String(str)));
}

From source file:com.openshift.restclient.utils.Base64Coder.java

/**
 * Decodes the given base64 encoded string. Returns <code>null</code> if the
 * given string is <code>null</code>.
 * /*from w w  w  . ja  va 2  s. c o m*/
 * @param encoded
 *            the base64 encoded string
 * @return the decoded string
 */
public static String decode(String encoded) {
    byte[] encodedBytes = decodeBinary(encoded);
    return (encodedBytes == null) ? encoded : new String(DatatypeConverter.parseBase64Binary(encoded));
}

From source file:fr.inria.oak.paxquery.pact.operators.binary.ThetaJoinOperator.java

@Override
public void open(Configuration parameters) throws Exception {
    super.open(parameters);

    String predEncoded = parameters.getString(PACTOperatorsConfiguration.PRED_BINARY.toString(), null);
    byte[] predBytes = DatatypeConverter.parseBase64Binary(predEncoded);
    this.pred = (BasePredicate) SerializationUtils.deserialize(predBytes);
}

From source file:fr.inria.oak.paxquery.pact.operators.BaseMapOperator.java

@Override
public void open(Configuration parameters) throws Exception {
    super.open(parameters);

    String inputRecordsSignatureEncoded = parameters
            .getString(PACTOperatorsConfiguration.NRSMD1_BINARY.toString(), null);
    byte[] inputRecordsSignatureBytes = DatatypeConverter.parseBase64Binary(inputRecordsSignatureEncoded);
    final NestedMetadata inputRecordsSignature = (NestedMetadata) SerializationUtils
            .deserialize(inputRecordsSignatureBytes);
    this.inputRecordsSignature = inputRecordsSignature;
}

From source file:fr.inria.oak.paxquery.pact.operators.BaseCoGroupOperator.java

@Override
public void open(Configuration parameters) throws Exception {
    super.open(parameters);

    String inputRecordsSignatureEncoded1 = parameters
            .getString(PACTOperatorsConfiguration.NRSMD1_BINARY.toString(), null);
    byte[] inputRecordsSignatureBytes1 = DatatypeConverter.parseBase64Binary(inputRecordsSignatureEncoded1);
    final NestedMetadata inputRecordsSignature1 = (NestedMetadata) SerializationUtils
            .deserialize(inputRecordsSignatureBytes1);
    this.inputRecordsSignature1 = inputRecordsSignature1;

    String inputRecordsSignatureEncoded2 = parameters
            .getString(PACTOperatorsConfiguration.NRSMD2_BINARY.toString(), null);
    byte[] inputRecordsSignatureBytes2 = DatatypeConverter.parseBase64Binary(inputRecordsSignatureEncoded2);
    final NestedMetadata inputRecordsSignature2 = (NestedMetadata) SerializationUtils
            .deserialize(inputRecordsSignatureBytes2);
    this.inputRecordsSignature2 = inputRecordsSignature2;
}

From source file:fr.inria.oak.paxquery.pact.operators.unary.ProjectionOperator.java

@Override
public void open(Configuration parameters) throws Exception {
    super.open(parameters);

    String keepColumnsEncoded = parameters.getString(PACTOperatorsConfiguration.KEEP_COLUMNS_BINARY.toString(),
            null);//from   ww w  .  jav  a  2s .c  o m
    byte[] keepColumnsBytes = DatatypeConverter.parseBase64Binary(keepColumnsEncoded);
    final int[] keepColumns = (int[]) SerializationUtils.deserialize(keepColumnsBytes);
    this.keepColumns = keepColumns;
}

From source file:fr.inria.oak.paxquery.pact.operators.unary.SelectionOperator.java

@Override
public void open(Configuration parameters) throws Exception {
    super.open(parameters);

    String predEncoded = parameters.getString(PACTOperatorsConfiguration.PRED_BINARY.toString(), null);
    byte[] predBytes = DatatypeConverter.parseBase64Binary(predEncoded);
    final BasePredicate pred = (BasePredicate) SerializationUtils.deserialize(predBytes);
    this.pred = pred;
}