Package com.nimbusds.jose.util

Examples of com.nimbusds.jose.util.Base64



  public void testGeneratorConstructor() {

    RefreshToken rt = new RefreshToken(16);
    assertEquals(16, new Base64(rt.getValue()).decode().length);
    assertTrue(rt.getParamNames().contains("refresh_token"));
    assertEquals(1, rt.getParamNames().size());
  }
View Full Code Here


    Base64URL k = new Base64URL("GawgguFyGrWKav7AX4VKUg");
    URL x5u = new URL("http://example.com/jwk.json");
    Base64URL x5t = new Base64URL("abc");
    List<Base64> x5c = new LinkedList<>();
    x5c.add(new Base64("def"));

    Set<KeyOperation> ops = new LinkedHashSet<>(Arrays.asList(KeyOperation.SIGN, KeyOperation.VERIFY));

    OctetSequenceKey key = new OctetSequenceKey(k, null, ops, JWSAlgorithm.HS256, "1", x5u, x5t, x5c);
View Full Code Here

    Base64URL k = new Base64URL("GawgguFyGrWKav7AX4VKUg");
    URL x5u = new URL("http://example.com/jwk.json");
    Base64URL x5t = new Base64URL("abc");
    List<Base64> x5c = new LinkedList<>();
    x5c.add(new Base64("def"));

    OctetSequenceKey key = new OctetSequenceKey(k, KeyUse.SIGNATURE, null, JWSAlgorithm.HS256, "1", x5u, x5t, x5c);

    assertEquals(KeyType.OCT, key.getKeyType());
    assertEquals(KeyUse.SIGNATURE, key.getKeyUse());
View Full Code Here

    Base64URL k = new Base64URL("GawgguFyGrWKav7AX4VKUg");
    URL x5u = new URL("http://example.com/jwk.json");
    Base64URL x5t = new Base64URL("abc");
    List<Base64> x5c = new LinkedList<>();
    x5c.add(new Base64("def"));

    Set<KeyOperation> ops = new LinkedHashSet<>(Arrays.asList(KeyOperation.SIGN, KeyOperation.VERIFY));

    OctetSequenceKey key = new OctetSequenceKey.Builder(k).
      keyOperations(ops).
View Full Code Here

    throws Exception {

    URL x5u = new URL("http://example.com/jwk.json");
    Base64URL x5t = new Base64URL("abc");
    List<Base64> x5c = new LinkedList<Base64>();
    x5c.add(new Base64("def"));

    RSAKey key = new RSAKey(new Base64URL(n), new Base64URL(e), new Base64URL(d),
                      new Base64URL(p), new Base64URL(q),
                      new Base64URL(dp), new Base64URL(dq), new Base64URL(qi),
                      null,
View Full Code Here

    throws Exception {

    URL x5u = new URL("http://example.com/jwk.json");
    Base64URL x5t = new Base64URL("abc");
    List<Base64> x5c = new LinkedList<Base64>();
    x5c.add(new Base64("def"));

    RSAKey key = new RSAKey.Builder(new Base64URL(n), new Base64URL(e)).
      privateExponent(new Base64URL(d)).
      firstPrimeFactor(new Base64URL(p)).
      secondPrimeFactor(new Base64URL(q)).
View Full Code Here

    throws Exception {

    URL x5u = new URL("http://example.com/jwk.json");
    Base64URL x5t = new Base64URL("abc");
    List<Base64> x5c = new LinkedList<Base64>();
    x5c.add(new Base64("def"));

    Set<KeyOperation> ops = new LinkedHashSet<KeyOperation>(Arrays.asList(KeyOperation.SIGN, KeyOperation.VERIFY));

    KeyPairGenerator keyGen = KeyPairGenerator.getInstance("RSA");
    keyGen.initialize(512);
View Full Code Here

    Base64URL k = new Base64URL("GawgguFyGrWKav7AX4VKUg");
    URL x5u = new URL("http://example.com/jwk.json");
    Base64URL x5t = new Base64URL("abc");
    List<Base64> x5c = new LinkedList<Base64>();
    x5c.add(new Base64("def"));

    Set<KeyOperation> ops = new LinkedHashSet<KeyOperation>(Arrays.asList(KeyOperation.SIGN, KeyOperation.VERIFY));

    OctetSequenceKey key = new OctetSequenceKey(k, null, ops, JWSAlgorithm.HS256, "1", x5u, x5t, x5c);
View Full Code Here

    Base64URL k = new Base64URL("GawgguFyGrWKav7AX4VKUg");
    URL x5u = new URL("http://example.com/jwk.json");
    Base64URL x5t = new Base64URL("abc");
    List<Base64> x5c = new LinkedList<Base64>();
    x5c.add(new Base64("def"));

    OctetSequenceKey key = new OctetSequenceKey(k, KeyUse.SIGNATURE, null, JWSAlgorithm.HS256, "1", x5u, x5t, x5c);

    assertEquals(KeyType.OCT, key.getKeyType());
    assertEquals(KeyUse.SIGNATURE, key.getKeyUse());
View Full Code Here

    Base64URL k = new Base64URL("GawgguFyGrWKav7AX4VKUg");
    URL x5u = new URL("http://example.com/jwk.json");
    Base64URL x5t = new Base64URL("abc");
    List<Base64> x5c = new LinkedList<Base64>();
    x5c.add(new Base64("def"));

    Set<KeyOperation> ops = new LinkedHashSet<KeyOperation>(Arrays.asList(KeyOperation.SIGN, KeyOperation.VERIFY));

    OctetSequenceKey key = new OctetSequenceKey.Builder(k).
      keyOperations(ops).
View Full Code Here

TOP

Related Classes of com.nimbusds.jose.util.Base64

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.