protected NoSamlNamespaceAbstractSaml10ResponseView() { try { this.idGenerator = new SecureRandomIdentifierGenerator(); } catch (final NoSuchAlgorithmException e) { throw new IllegalStateException("Cannot create secure random ID generator for SAML message IDs."); } }
public static String createID() { try { SecureRandomIdentifierGenerator generator = new SecureRandomIdentifierGenerator(); return generator.generateIdentifier(); } catch (NoSuchAlgorithmException e) { log.error("Error while building Secure Random ID", e); //TODO : throw exception and break the flow } return null; }
public static String createID() { try { SecureRandomIdentifierGenerator generator = new SecureRandomIdentifierGenerator(); return generator.generateIdentifier(); } catch (NoSuchAlgorithmException e) { log.error("Error while building Secure Random ID", e); //TODO : throw exception and break the flow } return null; }
/** * Generates a unique Id for Authentication Requests * * @return generated unique ID */ public static String createID() throws Exception { try { SecureRandomIdentifierGenerator generator = new SecureRandomIdentifierGenerator(); return generator.generateIdentifier(); } catch (NoSuchAlgorithmException e) { throw new Exception("Error while building Secure Random ID.", e); } }
/** * Generates a unique Id for Authentication Requests * * @return generated unique ID */ public static String createID() throws Exception { try { SecureRandomIdentifierGenerator generator = new SecureRandomIdentifierGenerator(); return generator.generateIdentifier(); } catch (NoSuchAlgorithmException e) { throw new Exception("Error while building Secure Random ID.", e); } }
/** * {@inheritDoc} * @see se.inera.pascal.ticket.core.SAML2AssertionGenerator#generateSAML2AssertionId(java.lang.String) */ @Override public String generateSAML2AssertionId(String algorithm) { if(secureRandomIdentifierGenerator == null){ try { if(StringUtils.isNotBlank(algorithm)) { secureRandomIdentifierGenerator = new SecureRandomIdentifierGenerator(algorithm); }else { secureRandomIdentifierGenerator = new SecureRandomIdentifierGenerator(); } }catch(NoSuchAlgorithmException e) { String message="Algoritm not supporterd : "; logger.error(message,e); } } return secureRandomIdentifierGenerator.generateIdentifier(); }
/** * Constructor. * * @param store store used to map tokens to principals * * @throws NoSuchAlgorithmException thrown if the SHA1PRNG, used as the default random number generation algorithm, * is not supported */ public TransientIdAttributeDefinition(StorageService<String, TransientIdEntry> store) throws NoSuchAlgorithmException { idGenerator = new SecureRandomIdentifierGenerator(); idStore = store; partition = "transientId"; idSize = 16; idLifetime = 1000 * 60 * 60 * 4; // Prime the generator idGenerator.generateIdentifier(idSize); }
/** * Helper method for constructors. */ private void init() { builderFactory = Configuration.getBuilderFactory(); keyInfoBuilder = (XMLSignatureBuilder<KeyInfo>) builderFactory.getBuilder(KeyInfo.DEFAULT_ELEMENT_NAME); dataReferenceBuilder = (XMLEncryptionBuilder<DataReference>) builderFactory.getBuilder(DataReference.DEFAULT_ELEMENT_NAME); referenceListBuilder = (XMLEncryptionBuilder<ReferenceList>) builderFactory.getBuilder(ReferenceList.DEFAULT_ELEMENT_NAME); retrievalMethodBuilder = (XMLSignatureBuilder<RetrievalMethod>) builderFactory.getBuilder(RetrievalMethod.DEFAULT_ELEMENT_NAME); keyNameBuilder = (XMLSignatureBuilder<KeyName>) builderFactory.getBuilder(KeyName.DEFAULT_ELEMENT_NAME); carriedKeyNameBuilder = (XMLEncryptionBuilder<CarriedKeyName>) builderFactory.getBuilder(CarriedKeyName.DEFAULT_ELEMENT_NAME); try{ idGenerator = new SecureRandomIdentifierGenerator(); }catch(NoSuchAlgorithmException e){ log.error("JVM does not support SHA1PRNG random number generation algorithm."); } keyPlacement = KeyPlacement.PEER; }