private void testAndSetInvocation() throws XMLSecurityException { if (invoked) { throw new XMLSecurityException("stax.recursiveKeyReference"); } invoked = true; }
@Override protected InputStream handleXOPInclude(InputProcessorChain inputProcessorChain, EncryptedDataType encryptedDataType, String href, Cipher cipher, InboundSecurityToken inboundSecurityToken) throws XMLSecurityException { throw new XMLSecurityException("errorMessages.NotYetImplementedException"); }
@Override protected void handleCipherReference(InputProcessorChain inputProcessorChain, EncryptedDataType encryptedDataType, Cipher cipher, InboundSecurityToken inboundSecurityToken) throws XMLSecurityException { throw new XMLSecurityException("errorMessages.NotYetImplementedException"); }
protected byte[] getBytesFromAttachment(String xopUri, final XMLSecurityProperties securityProperties) throws XMLSecurityException { throw new XMLSecurityException("errorMessages.NotYetImplementedException"); }
@Override public void engineInitSign(Key signingKey, AlgorithmParameterSpec algorithmParameterSpec) throws XMLSecurityException { try { mac.init(signingKey, algorithmParameterSpec); } catch (InvalidKeyException e) { throw new XMLSecurityException(e); } catch (InvalidAlgorithmParameterException e) { throw new XMLSecurityException(e); } }
@Override public void engineInitSign(Key signingKey) throws XMLSecurityException { try { mac.init(signingKey); } catch (InvalidKeyException e) { throw new XMLSecurityException(e); } }
@Override public void engineUpdate(byte[] input) throws XMLSecurityException { try { signature.update(input); } catch (SignatureException e) { throw new XMLSecurityException(e); } }
@Override public void engineInitSign(Key signingKey, AlgorithmParameterSpec algorithmParameterSpec) throws XMLSecurityException { try { signature.initSign((PrivateKey) signingKey); } catch (InvalidKeyException e) { throw new XMLSecurityException(e); } }
@Override public void engineUpdate(byte input) throws XMLSecurityException { try { signature.update(input); } catch (SignatureException e) { throw new XMLSecurityException(e); } }
@Override public void engineInitSign(Key signingKey, SecureRandom secureRandom) throws XMLSecurityException { try { mac.init(signingKey); } catch (InvalidKeyException e) { throw new XMLSecurityException(e); } }
@Override public void engineInitVerify(Key verificationKey) throws XMLSecurityException { try { mac.init(verificationKey); } catch (InvalidKeyException e) { throw new XMLSecurityException(e); } }
@Override public void engineInitSign(Key signingKey) throws XMLSecurityException { try { signature.initSign((PrivateKey) signingKey); } catch (InvalidKeyException e) { throw new XMLSecurityException(e); } }
@Override public void engineInitSign(Key signingKey, SecureRandom secureRandom) throws XMLSecurityException { try { signature.initSign((PrivateKey) signingKey, secureRandom); } catch (InvalidKeyException e) { throw new XMLSecurityException(e); } }
@Override public void engineInitVerify(Key verificationKey) throws XMLSecurityException { try { signature.initVerify((PublicKey) verificationKey); } catch (InvalidKeyException e) { throw new XMLSecurityException(e); } }
private byte[] generateDigest(byte[] inputBytes) throws XMLSecurityException { try { return MessageDigest.getInstance("SHA-1").digest(inputBytes); } catch (NoSuchAlgorithmException e) { throw new XMLSecurityException(e); } }
@Override public void doFinal(InputProcessorChain inputProcessorChain) throws XMLStreamException, XMLSecurityException { if (!signatureElementFound && !encryptedDataElementFound) { throw new XMLSecurityException("stax.unsecuredMessage"); } super.doFinal(inputProcessorChain); }
@Override public void engineSetParameter(AlgorithmParameterSpec params) throws XMLSecurityException { try { signature.setParameter(params); } catch (InvalidAlgorithmParameterException e) { throw new XMLSecurityException(e); } } }
@Override public void doFinal(OutputProcessorChain outputProcessorChain) throws XMLSecurityException { try { xmlEventWriter.flush(); xmlEventWriter.close(); } catch (XMLStreamException e) { throw new XMLSecurityException(e); } } }