@Deprecated public String hmac384(SecretKey sharedSecret) { StringBuilder buffer = new StringBuilder(); byte[] data = marshalContent(); encode(Algorithm.HS384, data, buffer); byte[] signature = null; try { signature = HMACProvider.sign(buffer.toString().getBytes("UTF-8"), Algorithm.HS384, sharedSecret); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } return encodeAll(buffer, signature); }
@Deprecated public String hmac256(SecretKey sharedSecret) { StringBuilder buffer = new StringBuilder(); byte[] data = marshalContent(); encode(Algorithm.HS256, data, buffer); byte[] signature = null; try { signature = HMACProvider.sign(buffer.toString().getBytes("UTF-8"), Algorithm.HS256, sharedSecret); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } return encodeAll(buffer, signature); }
public String none() { StringBuilder buffer = new StringBuilder(); byte[] data = marshalContent(); encode(Algorithm.none, data, buffer); return encodeAll(buffer, null); }
@Deprecated public String hmac512(byte[] sharedSecret) { StringBuilder buffer = new StringBuilder(); byte[] data = marshalContent(); encode(Algorithm.HS512, data, buffer); byte[] signature = null; try { signature = HMACProvider.sign(buffer.toString().getBytes("UTF-8"), Algorithm.HS512, sharedSecret); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } return encodeAll(buffer, signature); }
@Deprecated public String sign(Algorithm algorithm, PrivateKey privateKey) { StringBuilder buffer = new StringBuilder(); byte[] data = marshalContent(); encode(algorithm, data, buffer); byte[] signature = null; try { signature = RSAProvider.sign(buffer.toString().getBytes("UTF-8"), algorithm, privateKey); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } return encodeAll(buffer, signature); }
@Deprecated public String hmac256(byte[] sharedSecret) { StringBuilder buffer = new StringBuilder(); byte[] data = marshalContent(); encode(Algorithm.HS256, data, buffer); byte[] signature = null; try { signature = HMACProvider.sign(buffer.toString().getBytes("UTF-8"), Algorithm.HS256, sharedSecret); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } return encodeAll(buffer, signature); }
@Deprecated public String hmac384(byte[] sharedSecret) { StringBuilder buffer = new StringBuilder(); byte[] data = marshalContent(); encode(Algorithm.HS384, data, buffer); byte[] signature = null; try { signature = HMACProvider.sign(buffer.toString().getBytes("UTF-8"), Algorithm.HS384, sharedSecret); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } return encodeAll(buffer, signature); }
@Deprecated public String hmac512(SecretKey sharedSecret) { StringBuilder buffer = new StringBuilder(); byte[] data = marshalContent(); encode(Algorithm.HS512, data, buffer); byte[] signature = null; try { signature = HMACProvider.sign(buffer.toString().getBytes("UTF-8"), Algorithm.HS512, sharedSecret); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } return encodeAll(buffer, signature); } }
public String sign(SignatureSignerContext signer) { kid = signer.getKid(); StringBuilder buffer = new StringBuilder(); byte[] data = marshalContent(); encode(signer.getAlgorithm(), data, buffer); byte[] signature = null; try { signature = signer.sign(buffer.toString().getBytes("UTF-8")); } catch (Exception e) { throw new RuntimeException(e); } return encodeAll(buffer, signature); }