Example usage for java.security AlgorithmParameters getEncoded

List of usage examples for java.security AlgorithmParameters getEncoded

Introduction

In this page you can find the example usage for java.security AlgorithmParameters getEncoded.

Prototype

public final byte[] getEncoded() throws IOException 

Source Link

Document

Returns the parameters in their primary encoding format.

Usage

From source file:org.alfresco.encryption.DefaultEncryptionUtils.java

/**
 * {@inheritDoc}//from  w  w  w .  ja v  a2s  . c  o m
 */
@Override
public void setRequestAlgorithmParameters(HttpMethod method, AlgorithmParameters params) throws IOException {
    if (params != null) {
        method.setRequestHeader(HEADER_ALGORITHM_PARAMETERS, Base64.encodeBytes(params.getEncoded()));
    }
}

From source file:org.alfresco.encryption.DefaultEncryptionUtils.java

/**
 * Set the algorithm parameters header on the HTTP response
 * //w ww.  java  2  s  .co  m
 * @param response HttpServletResponse
 * @param params AlgorithmParameters
 * @throws IOException
 */
protected void setAlgorithmParameters(HttpServletResponse response, AlgorithmParameters params)
        throws IOException {
    if (params != null) {
        response.setHeader(HEADER_ALGORITHM_PARAMETERS, Base64.encodeBytes(params.getEncoded()));
    }
}