congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
Base64.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
com.nimbusds.jose.util.Base64
constructor

Best Java code snippets using com.nimbusds.jose.util.Base64.<init> (Showing top 11 results out of 315)

origin: org.apereo.cas/cas-server-support-token-authentication

  /**
   * Convert secret to bytes honoring {@link RegisteredServiceProperty.RegisteredServiceProperties#TOKEN_SECRETS_ARE_BASE64_ENCODED}
   * config parameter.
   *
   * @param secret                - String to be represented to byte[]
   * @param secretIsBase64Encoded - is this a base64 encoded #secret?
   * @return byte[] representation of #secret
   */
  private static byte[] getSecretBytes(final String secret, final boolean secretIsBase64Encoded) {
    return secretIsBase64Encoded ? new Base64(secret).decode() : secret.getBytes(UTF_8);
  }
}
origin: com.nimbusds/nimbus-jose-jwt

/**
 * Base64-encodes the specified byte array. 
 *
 * @param bytes The byte array to encode. Must not be {@code null}.
 *
 * @return The resulting Base64 object.
 */
public static Base64 encode(final byte[] bytes) {
  return new Base64(Base64Codec.encodeToString(bytes, false));
}
origin: org.pac4j/pac4j-jwt

public void setSecretBase64(final String secret) {
  this.secret = new Base64(secret).decode();
}
origin: de.adorsys.oauth/oauth-server

private static byte[] getSecretKey() {
  return new Base64(SECRET_KEY).decode();
}

origin: org.pac4j/pac4j-jwt

public void setSecretBase64(final String secret) {
  this.secret = new Base64(secret).decode();
}
origin: de.adorsys.oauth/oauth-server

private String[] getNamePassword(HttpServletRequest httpRequest) {
  String authValue = httpRequest.getHeader("Authorization");
  if (authValue != null && authValue.startsWith("Basic ")) {
    String encodedValue = authValue.substring(6);
    String decodedValue = new Base64(encodedValue).decodeToString();
    final String[] namePassword = decodedValue.contains(":") ? decodedValue.split(":")
        : new String[] { decodedValue, "" };
    return namePassword;
  } else if (httpRequest.getContentType().contains("application/x-www-form-urlencoded")) {
    String clientId = httpRequest.getParameter("client_id");
    String clientSecret = httpRequest.getParameter("client_secret");
    if (clientId == null || clientSecret == null) {
      return null;
    }
    return new String[]{clientId, clientSecret};
  } else {
    return null;			
  }
}
origin: com.nimbusds/nimbus-jose-jwt

/**
 * Parses a PEM-encoded X.509 certificate.
 *
 * @param pemEncodedCert The PEM-encoded X.509 certificate, as a
 *                       string. May be {@code null}.
 *
 * @return The X.509 certificate, {@code null} if parsing failed.
 */
public static X509Certificate parse(final String pemEncodedCert) {
  if (pemEncodedCert == null || pemEncodedCert.isEmpty()) {
    return null;
  }
  final int markerStart = pemEncodedCert.indexOf(PEM_BEGIN_MARKER);
  if (markerStart < 0) {
    return null;
  }
  String buf = pemEncodedCert.substring(markerStart + PEM_BEGIN_MARKER.length());
  final int markerEnd = buf.indexOf(PEM_END_MARKER);
  if (markerEnd < 0) {
    return null;
  }
  buf = buf.substring(0, markerEnd);
  buf = buf.replaceAll("\\s", "");
  return parse(new Base64(buf).decode());
}

origin: com.nimbusds/nimbus-jose-jwt

/**
 * Converts the specified JSON array of strings to a list of Base64
 * encoded objects.
 *
 * @param jsonArray The JSON array of string, {@code null} if not
 *                  specified.
 *
 * @return The Base64 list, {@code null} if not specified.
 *
 * @throws ParseException If parsing failed.
 */
public static List<Base64> toBase64List(final JSONArray jsonArray)
  throws ParseException {
  
  if (jsonArray == null)
    return null;
  List<Base64> chain = new LinkedList<>();
  for (int i=0; i < jsonArray.size(); i++) {
    Object item = jsonArray.get(i);
    if (item == null) {
      throw new ParseException("The X.509 certificate at position " + i + " must not be null", 0);
    }
    if  (! (item instanceof String)) {
      throw new ParseException("The X.509 certificate at position " + i + " must be encoded as a Base64 string", 0);
    }
    chain.add(new Base64((String)item));
  }
  return chain;
}

origin: com.microsoft.aad/adal4j

JWSHeader.Builder builder = new Builder(JWSAlgorithm.RS256);
List<Base64> certs = new ArrayList<Base64>();
certs.add(new Base64(credential.getPublicCertificate()));
builder.x509CertChain(certs);
builder.x509CertThumbprint(new Base64URL(credential
origin: com.microsoft.azure/adal4j

JWSHeader.Builder builder = new Builder(JWSAlgorithm.RS256);
List<Base64> certs = new ArrayList<Base64>();
certs.add(new Base64(credential.getPublicCertificate()));
builder.x509CertChain(certs);
builder.x509CertThumbprint(new Base64URL(credential
origin: AzureAD/azure-activedirectory-library-for-java

JWSHeader.Builder builder = new Builder(JWSAlgorithm.RS256);
List<Base64> certs = new ArrayList<Base64>();
certs.add(new Base64(credential.getPublicCertificate()));
builder.x509CertChain(certs);
builder.x509CertThumbprint(new Base64URL(credential
com.nimbusds.jose.utilBase64<init>

Javadoc

Creates a new Base64-encoded object.

Popular methods of Base64

  • decode
    Decodes this Base64 object to a byte array.
  • encode
    Base64-encodes the specified byte array.
  • toString
    Returns a Base64 string representation of this object. The string will be chunked into 76 character
  • decodeToString
    Decodes this Base64 object to a string.

Popular in Java

  • Finding current android device location
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • onRequestPermissionsResult (Fragment)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • Kernel (java.awt.image)
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • 21 Best IntelliJ Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now