public static byte[] decodeSequence(String encodedSequence) throws SecurityException { try { return Base64UrlUtility.decode(encodedSequence); } catch (Exception ex) { throw new SecurityException(ex); } }
public static byte[] decodeSequence(String encodedSequence) throws SecurityException { try { return Base64UrlUtility.decode(encodedSequence); } catch (Exception ex) { throw new SecurityException(ex); } }
public HmacJwsSignatureProvider(String encodedKey, SignatureAlgorithm algo) { super(algo); try { this.key = Base64UrlUtility.decode(encodedKey); } catch (Base64Exception ex) { LOG.warning("Hmac key can not be decoded"); throw new JwsException(JwsException.Error.INVALID_KEY, ex); } }
private InputStream decodeAssertion(String assertion) { try { byte[] deflatedToken = Base64UrlUtility.decode(assertion); return new ByteArrayInputStream(deflatedToken); } catch (Base64Exception ex) { throw new OAuthServiceException(OAuthConstants.INVALID_GRANT); } }
private byte[] getDecodedBytes(Object p2sHeader) { try { return Base64UrlUtility.decode(p2sHeader.toString()); } catch (Exception ex) { throw new JoseException(ex); } } @Override
private InputStream decodeAssertion(String assertion) { try { byte[] deflatedToken = Base64UrlUtility.decode(assertion); return new ByteArrayInputStream(deflatedToken); } catch (Base64Exception ex) { throw new OAuthServiceException(OAuthConstants.INVALID_GRANT); } }
public HmacJwsSignatureProvider(String encodedKey, SignatureAlgorithm algo) { super(algo); try { this.key = Base64UrlUtility.decode(encodedKey); } catch (Base64Exception ex) { LOG.warning("Hmac key can not be decoded"); throw new JwsException(JwsException.Error.INVALID_KEY, ex); } }
private byte[] getDecodedBytes(Object p2sHeader) { try { return Base64UrlUtility.decode(p2sHeader.toString()); } catch (Exception ex) { throw new JoseException(ex); } } @Override
public static boolean compareCertificateThumbprints(X509Certificate cert, String encodedThumbprint) { try { byte[] thumbprint = createCertificateThumbprint(cert); byte[] currentThumbprint = Base64UrlUtility.decode(encodedThumbprint); return MessageDigest.isEqual(thumbprint, currentThumbprint); } catch (Exception ex) { return false; } }
public static boolean compareCertificateThumbprints(X509Certificate cert, String encodedThumbprint) { try { byte[] thumbprint = createCertificateThumbprint(cert); byte[] currentThumbprint = Base64UrlUtility.decode(encodedThumbprint); return MessageDigest.isEqual(thumbprint, currentThumbprint); } catch (Exception ex) { return false; } }
protected Element readToken(Message message, String assertion) { if (assertion == null) { throw ExceptionUtils.toNotAuthorizedException(null, null); } try { byte[] deflatedToken = Base64UrlUtility.decode(assertion); InputStream is = new ByteArrayInputStream(deflatedToken); return readToken(message, is); } catch (Base64Exception ex) { throw ExceptionUtils.toNotAuthorizedException(null, null); } }
byte[] decodedThumbprint = Base64UrlUtility.decode(thumbprint);
private byte[] getDecodedBytes(JweDecryptionInput jweDecryptionInput, String headerName) { try { Object ivHeader = jweDecryptionInput.getJweHeaders().getHeader(headerName); return Base64UrlUtility.decode(ivHeader.toString()); } catch (Exception ex) { throw new JoseException(ex); } } protected void validateKeyEncryptionAlgorithm(String keyAlgo) {
protected Element readToken(Message message, String assertion) { if (assertion == null) { throw ExceptionUtils.toNotAuthorizedException(null, null); } try { byte[] deflatedToken = Base64UrlUtility.decode(assertion); InputStream is = new ByteArrayInputStream(deflatedToken); return readToken(message, is); } catch (Base64Exception ex) { throw ExceptionUtils.toNotAuthorizedException(null, null); } }
private byte[] getDecodedBytes(JweDecryptionInput jweDecryptionInput, String headerName) { try { Object ivHeader = jweDecryptionInput.getJweHeaders().getHeader(headerName); return Base64UrlUtility.decode(ivHeader.toString()); } catch (Exception ex) { throw new JoseException(ex); } } protected void validateKeyEncryptionAlgorithm(String keyAlgo) {
byte[] decodedThumbprint = Base64UrlUtility.decode(thumbprint);
String headersJson = new String(Base64UrlUtility.decode(parts[0])); byte[] encryptedCEK = Base64UrlUtility.decode(parts[1]); byte[] initVector = Base64UrlUtility.decode(parts[2]); byte[] encryptedContent = Base64UrlUtility.decode(parts[3]); byte[] authTag = Base64UrlUtility.decode(parts[4]); JsonMapObjectReaderWriter reader = new JsonMapObjectReaderWriter(); JsonMapObject joseHeaders = reader.fromJsonToJsonObject(headersJson);
String headersJson = new String(Base64UrlUtility.decode(parts[0])); byte[] encryptedCEK = Base64UrlUtility.decode(parts[1]); byte[] initVector = Base64UrlUtility.decode(parts[2]); byte[] encryptedContent = Base64UrlUtility.decode(parts[3]); byte[] authTag = Base64UrlUtility.decode(parts[4]); JsonMapObjectReaderWriter reader = new JsonMapObjectReaderWriter(); JsonMapObject joseHeaders = reader.fromJsonToJsonObject(headersJson);