Tabnine Logo
JsonSerialization
Code IndexAdd Tabnine to your IDE (free)

How to use
JsonSerialization
in
org.jboss.resteasy.jwt

Best Java code snippets using org.jboss.resteasy.jwt.JsonSerialization (Showing top 17 results out of 315)

origin: resteasy/Resteasy

public static <T> T fromString(Class<T> type, String json, ResteasyProviderFactory factory) throws Exception
{
 byte[] bytes = json.getBytes(StandardCharsets.UTF_8);
 return fromBytes(type, bytes, factory);
}
origin: resteasy/Resteasy

public static String toString(Object token, ResteasyProviderFactory factory) throws Exception
{
 byte[] bytes = toByteArray(token, factory);
 return new String(bytes);
}
origin: org.jboss.resteasy/skeleton-key-idp

try
 scope = JsonSerialization.fromBytes(SkeletonKeyScope.class, bytes);
 try
   String json = JsonSerialization.toString(scope, false);
   scopeParam = Base64Url.encode(json.getBytes(StandardCharsets.UTF_8));
origin: resteasy/Resteasy

public static <T> T fromString(Class<T> type, String json) throws Exception
{
 byte[] bytes = json.getBytes(StandardCharsets.UTF_8);
 return fromBytes(type, bytes);
}
origin: resteasy/Resteasy

public static String toString(Object token, boolean indent) throws Exception
{
 byte[] bytes = toByteArray(token, indent);
 return new String(bytes);
}
origin: resteasy/Resteasy

public static <T> T fromBytes(Class<T> type, byte[] bytes) throws IOException
{
 ResteasyProviderFactory factory = new ResteasyProviderFactoryImpl();
 factory.register(ResteasyJackson2Provider.class);
 factory.register(JWTContextResolver.class);
 return fromBytes(type, bytes, factory);
}
origin: resteasy/Resteasy

public static byte[] toByteArray(Object token, boolean indent) throws Exception
{
 ResteasyProviderFactory factory = new ResteasyProviderFactoryImpl();
 factory.register(new JWTContextResolver(indent));
 factory.register(ResteasyJackson2Provider.class);
 return toByteArray(token, factory);
}
origin: org.jboss.resteasy/jose-jwt

public static <T> T fromString(Class<T> type, String json, ResteasyProviderFactory factory) throws Exception
{
 byte[] bytes = json.getBytes(StandardCharsets.UTF_8);
 return fromBytes(type, bytes, factory);
}
origin: org.jboss.resteasy/jose-jwt

public static String toString(Object token, ResteasyProviderFactory factory) throws Exception
{
 byte[] bytes = toByteArray(token, factory);
 return new String(bytes);
}
origin: org.jboss.resteasy/jose-jwt

public static <T> T fromString(Class<T> type, String json) throws Exception
{
 byte[] bytes = json.getBytes(StandardCharsets.UTF_8);
 return fromBytes(type, bytes);
}
origin: org.jboss.resteasy/jose-jwt

public static String toString(Object token, boolean indent) throws Exception
{
 byte[] bytes = toByteArray(token, indent);
 return new String(bytes);
}
origin: org.jboss.resteasy/jose-jwt

public static <T> T fromBytes(Class<T> type, byte[] bytes) throws IOException
{
 ResteasyProviderFactory factory = new ResteasyProviderFactory();
 factory.register(ResteasyJacksonProvider.class);
 factory.register(JWTContextResolver.class);
 return fromBytes(type, bytes, factory);
}
origin: org.jboss.resteasy/skeleton-key-as7

protected String buildTokenString(PrivateKey privateKey, SkeletonKeyToken token)
{
 byte[] tokenBytes = null;
 try
 {
   tokenBytes = JsonSerialization.toByteArray(token, false);
 }
 catch (Exception e)
 {
   throw new RuntimeException(e);
 }
 return new JWSBuilder()
    .content(tokenBytes)
    .rsa256(privateKey);
}
origin: org.jboss.resteasy/skeleton-key-idp

try
 scope = JsonSerialization.fromBytes(SkeletonKeyScope.class, bytes);
origin: org.jboss.resteasy/jose-jwt

public static byte[] toByteArray(Object token, boolean indent) throws Exception
{
 ResteasyProviderFactory factory = new ResteasyProviderFactory();
 factory.register(new JWTContextResolver(indent));
 factory.register(ResteasyJacksonProvider.class);
 return toByteArray(token, factory);
}
origin: org.jboss.resteasy/skeleton-key-core

try
  token = JsonSerialization.fromBytes(SkeletonKeyToken.class, input.getContent());
origin: org.jboss.resteasy/skeleton-key-idp

protected AccessTokenResponse accessTokenResponse(PrivateKey privateKey, SkeletonKeyToken token)
{
 byte[] tokenBytes = null;
 try
 {
   tokenBytes = JsonSerialization.toByteArray(token, false);
 }
 catch (Exception e)
 {
   throw new RuntimeException(e);
 }
 String encodedToken = new JWSBuilder()
    .content(tokenBytes)
    .rsa256(privateKey);
 AccessTokenResponse res = new AccessTokenResponse();
 res.setToken(encodedToken);
 res.setTokenType("bearer");
 if (token.getExpiration() != 0)
 {
   long time = token.getExpiration() - (System.currentTimeMillis() / 1000);
   res.setExpiresIn(time);
 }
 return res;
}
org.jboss.resteasy.jwtJsonSerialization

Most used methods

  • fromBytes
  • toByteArray
  • toString

Popular in Java

  • Start an intent from android
  • startActivity (Activity)
  • findViewById (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • JPanel (javax.swing)
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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