Examples of JweDecryptionOutput


Examples of org.apache.cxf.rs.security.oauth2.jwe.JweDecryptionOutput

@PreMatching
@Priority(Priorities.JWE_SERVER_READ_PRIORITY)
public class JweContainerRequestFilter extends AbstractJweDecryptingFilter implements ContainerRequestFilter {
    @Override
    public void filter(ContainerRequestContext context) throws IOException {
        JweDecryptionOutput out = decrypt(context.getEntityStream());
        byte[] bytes = out.getContent();
        context.setEntityStream(new ByteArrayInputStream(bytes));
        context.getHeaders().putSingle("Content-Length", Integer.toString(bytes.length));
        String ct = JwtUtils.checkContentType(out.getHeaders().getContentType(), getDefaultMediaType());
        if (ct != null) {
            context.getHeaders().putSingle("Content-Type", ct);
        }
    }
View Full Code Here

Examples of org.apache.cxf.rs.security.oauth2.jwe.JweDecryptionOutput

@Priority(Priorities.JWE_CLIENT_READ_PRIORITY)
public class JweClientResponseFilter extends AbstractJweDecryptingFilter implements ClientResponseFilter {
    @Override
    public void filter(ClientRequestContext req, ClientResponseContext res) throws IOException {
        JweDecryptionOutput out = decrypt(res.getEntityStream());
        byte[] bytes = out.getContent();
        res.setEntityStream(new ByteArrayInputStream(bytes));
        res.getHeaders().putSingle("Content-Length", Integer.toString(bytes.length));
        String ct = JwtUtils.checkContentType(out.getHeaders().getContentType(), getDefaultMediaType());
        if (ct != null) {
            res.getHeaders().putSingle("Content-Type", ct);
        }
    }
View Full Code Here

Examples of org.apache.cxf.rs.security.oauth2.jwe.JweDecryptionOutput

    private JweDecryption decryption;
    private JweCryptoProperties cryptoProperties;
    private String defaultMediaType;
    protected JweDecryptionOutput decrypt(InputStream is) throws IOException {
        JweDecryption theDecryptor = getInitializedDecryption();
        JweDecryptionOutput out = theDecryptor.decrypt(new String(IOUtils.readBytesFromStream(is), "UTF-8"));
        validateHeaders(out.getHeaders());
        return out;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.