Skip to content

Commit

Permalink
Merge pull request axboot#60 from visavis2k/master
Browse files Browse the repository at this point in the history
Replace DatatypeConverter with Commons Codec Base64
  • Loading branch information
Brant authored Jan 9, 2018
2 parents 746dbd3 + ec96556 commit 27b9701
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
import com.chequer.axboot.admin.domain.user.SessionUser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.commons.codec.binary.Base64;
import org.springframework.security.core.authority.SimpleGrantedAuthority;

import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import javax.xml.bind.DatatypeConverter;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.security.InvalidKeyException;
Expand Down Expand Up @@ -80,11 +80,11 @@ private byte[] toJSON(SessionUser user) {
}

private String toBase64(byte[] content) {
return DatatypeConverter.printBase64Binary(content);
return Base64.encodeBase64URLSafeString(content);
}

private byte[] fromBase64(String content) {
return DatatypeConverter.parseBase64Binary(content);
return Base64.decodeBase64(content);
}

private synchronized byte[] createHmac(byte[] content) {
Expand Down

0 comments on commit 27b9701

Please sign in to comment.