any(DiscoveryInformation.class))) .thenThrow(new MessageException("")) .thenThrow(new AssociationException("")) .thenThrow(new DiscoveryException(""));
protected byte[] sign(byte[] data) throws AssociationException { try { String algorithm = _macKey.getAlgorithm(); Mac mac = Mac.getInstance(algorithm); mac.init(_macKey); return mac.doFinal(data); } catch (GeneralSecurityException e) { throw new AssociationException("Cannot sign!", e); } }
protected byte[] sign(byte[] data) throws AssociationException { try { String algorithm = _macKey.getAlgorithm(); Mac mac = Mac.getInstance(algorithm); mac.init(_macKey); return mac.doFinal(data); } catch (GeneralSecurityException e) { throw new AssociationException("Cannot sign!", e); } }
protected byte[] sign(byte[] data) throws AssociationException { try { String algorithm = _macKey.getAlgorithm(); Mac mac = Mac.getInstance(algorithm); mac.init(_macKey); return mac.doFinal(data); } catch (GeneralSecurityException e) { throw new AssociationException("Cannot sign!", e); } }
public String sign(String text) throws AssociationException { if (DEBUG) _log.debug("Computing signature for input data:\n" + text); try { String signature = new String(Base64.encodeBase64(sign(text.getBytes("utf-8"))), "utf-8"); if (DEBUG) _log.debug("Calculated signature: " + signature); return signature; } catch (UnsupportedEncodingException e) { throw new AssociationException("Unsupported encoding for signed text.", e); } }
public String sign(String text) throws AssociationException { if (DEBUG) _log.debug("Computing signature for input data:\n" + text); try { String signature = new String(Base64.encodeBase64(sign(text.getBytes("utf-8"))), "utf-8"); if (DEBUG) _log.debug("Calculated signature: " + signature); return signature; } catch (UnsupportedEncodingException e) { throw new AssociationException("Unsupported encoding for signed text.", e); } }
protected byte[] sign(byte[] data) throws AssociationException { try { String algorithm = _macKey.getAlgorithm(); Mac mac = Mac.getInstance(algorithm); mac.init(_macKey); return mac.doFinal(data); } catch (GeneralSecurityException e) { throw new AssociationException("Cannot sign!", e); } }
public String sign(String text) throws AssociationException { if (DEBUG) _log.debug("Computing signature for input data:\n" + text); try { String signature = new String(Base64.encodeBase64(sign(text.getBytes("utf-8"))), "utf-8"); if (DEBUG) _log.debug("Calculated signature: " + signature); return signature; } catch (UnsupportedEncodingException e) { throw new AssociationException("Unsupported encoding for signed text.", e); } }
public String sign(String text) throws AssociationException { if (DEBUG) { _log.debug("Computing signature for input data:\n" + text); } try { String signature = new String(Base64.encodeBase64(sign(text.getBytes("utf-8"))), "utf-8"); if (DEBUG) { _log.debug("Calculated signature: " + signature); } return signature; } catch (UnsupportedEncodingException e) { throw new AssociationException("Unsupported encoding for signed text.", e); } }
public String sign(String text) throws AssociationException { if (DEBUG) _log.debug("Computing signature for input data:\n" + text); try { String signature = new String(Base64.encodeBase64(sign(text.getBytes("utf-8"))), "utf-8"); if (DEBUG) _log.debug("Calculated signature: " + signature); return signature; } catch (UnsupportedEncodingException e) { throw new AssociationException("Unsupported encoding for signed text.", e); } }
protected byte[] sign(byte[] data) throws AssociationException { try { String algorithm = _macKey.getAlgorithm(); Mac mac = Mac.getInstance(algorithm); mac.init(_macKey); return mac.doFinal(data); } catch (GeneralSecurityException e) { throw new AssociationException("Cannot sign!", e); } }
public static Association generate(String type, String handle, int expiryIn) throws AssociationException { if (TYPE_HMAC_SHA1.equals(type)) { return generateHmacSha1(handle, expiryIn); } else if (TYPE_HMAC_SHA256.equals(type)) { return generateHmacSha256(handle, expiryIn); } else { throw new AssociationException("Unknown association type: " + type); } }
public static Association generate(String type, String handle, int expiryIn) throws AssociationException { if (TYPE_HMAC_SHA1.equals(type)) { return generateHmacSha1(handle, expiryIn); } else if (TYPE_HMAC_SHA256.equals(type)) { return generateHmacSha256(handle, expiryIn); } else { throw new AssociationException("Unknown association type: " + type); } }
public Association generate(String type, int expiryIn) throws AssociationException { String tmpHandle = ""; Association tmpAssociation = Association.generate(type, tmpHandle, expiryIn); try { return setHandle(tmpAssociation); } catch (Exception e) { throw new AssociationException("error creating association: " + e.getMessage(), e); } }
public static Association generate(String type, String handle, int expiryIn) throws AssociationException { if (TYPE_HMAC_SHA1.equals(type)) { return generateHmacSha1(handle, expiryIn); } else if (TYPE_HMAC_SHA256.equals(type)) { return generateHmacSha256(handle, expiryIn); } else { throw new AssociationException("Unknown association type: " + type); } }
public static Association generate(String type, String handle, int expiryIn) throws AssociationException { if (TYPE_HMAC_SHA1.equals(type)) { return generateHmacSha1(handle, expiryIn); } else if (TYPE_HMAC_SHA256.equals(type)) { return generateHmacSha256(handle, expiryIn); } else { throw new AssociationException("Unknown association type: " + type); } }
private DiffieHellmanSession(AssociationSessionType type, DHParameterSpec dhParameterSpec) throws AssociationException { _type = type; _dhParameterSpec = dhParameterSpec; _keyPair = generateKeyPair(dhParameterSpec); try { _hDigest = MessageDigest.getInstance(_type.getHAlgorithm()); } catch (NoSuchAlgorithmException e) { throw new AssociationException("Unsupported H algorithm: " + _type.getHAlgorithm(), e); } }
/** * @see org.openid4java.server.ServerAssociationStore#generate(java.lang.String, int) */ public Association generate(String type, int expiryIn) throws AssociationException { Association association = store.generate(type, expiryIn); try { addToken(association.getHandle(), association); } catch (IOException e) { throw new AssociationException(e); } return association; }
/** * @see org.openid4java.server.ServerAssociationStore#generate(java.lang.String, int) */ public Association generate(String type, int expiryIn) throws AssociationException { Association association = store.generate(type, expiryIn); try { addToken(association.getHandle(), association); } catch (IOException e) { throw new AssociationException(e); } return association; }
/** * @see org.openid4java.server.ServerAssociationStore#generate(java.lang.String, int) */ public Association generate(String type, int expiryIn) throws AssociationException { Association association = store.generate(type, expiryIn); try { addToken(association.getHandle(), association); } catch (IOException e) { throw new AssociationException(e); } return association; }