/** * Create a KeyInfoBean that contains an X.509 certificate or Public Key */ protected static KeyInfoBean createPublicKeyKeyInfo(X509Certificate certificate, PublicKey publicKey) { KeyInfoBean keyInfo = new KeyInfoBean(); if (certificate != null) { keyInfo.setCertificate(certificate); keyInfo.setCertIdentifer(CERT_IDENTIFIER.X509_CERT); } else if (publicKey != null) { keyInfo.setPublicKey(publicKey); keyInfo.setCertIdentifer(CERT_IDENTIFIER.KEY_VALUE); } return keyInfo; }
protected KeyInfoBean createKeyInfo() throws Exception { Crypto crypto = CryptoFactory.getInstance("alice.properties"); CryptoType cryptoType = new CryptoType(CryptoType.TYPE.ALIAS); cryptoType.setAlias("alice"); X509Certificate[] certs = crypto.getX509Certificates(cryptoType); KeyInfoBean keyInfo = new KeyInfoBean(); keyInfo.setCertificate(certs[0]); keyInfo.setCertIdentifer(CERT_IDENTIFIER.X509_CERT); return keyInfo; }
KeyInfoBean keyInfo = new KeyInfoBean(); keyInfo.setCertificate(secToken.getX509Certificate()); keyInfo.setEphemeralKey(secToken.getSecret()); subjectBean = new SubjectBean("", "", ""); subjectBean.setKeyInfo(keyInfo);
RSSecurityUtils.getUserName(m, crypto, SecurityConstants.SIGNATURE_USERNAME))[0]; KeyInfoBean keyInfo = new KeyInfoBean(); keyInfo.setCertificate(cert); subjectBean.setKeyInfo(keyInfo); } catch (Exception ex) {
Crypto encryptionCrypto ) throws WSSecurityException { KeyInfoBean keyInfo = new KeyInfoBean(); keyInfoElement.appendChild(encryptedKeyElement); keyInfo.setElement(keyInfoElement);
if (keyInfo.getElement() != null) { return (KeyInfo)OpenSAMLUtil.fromDom(keyInfo.getElement()); } else { if (keyInfo.getCertificate() != null) { BasicCredential keyInfoCredential = new BasicX509Credential(keyInfo.getCertificate()); KeyInfoBean.CERT_IDENTIFIER certIdentifier = keyInfo.getCertIdentifer(); switch (certIdentifier) { case X509_CERT: } else if (keyInfo.getPublicKey() != null) { BasicCredential keyInfoCredential = new BasicCredential(keyInfo.getPublicKey()); BasicKeyInfoGeneratorFactory kiFactory = new BasicKeyInfoGeneratorFactory(); kiFactory.setEmitPublicKeyValue(true);
KeyInfoBean keyInfoBean = subjectBean.getKeyInfo(); if (keyInfoBean != null) { X509Certificate x509Certificate = keyInfoBean.getCertificate(); if (x509Certificate != null) { String alias = ((WSSSecurityProperties) getSecurityProperties()).getSignatureCrypto(). samlKeyInfo.setPrivateKey(((WSSSecurityProperties) getSecurityProperties()). getSignatureCrypto().getPrivateKey(alias, wsPasswordCallback.getPassword())); } else if (keyInfoBean.getPublicKey() != null) { PublicKey publicKey = keyInfoBean.getPublicKey(); samlKeyInfo.setPublicKey(publicKey); samlKeyInfo.setPrivateKey(((WSSSecurityProperties) getSecurityProperties()). samlCallback.getIssuerKeyName(), samlCallback.getIssuerKeyPassword())); } else { samlKeyInfo.setSecret(keyInfoBean.getEphemeralKey());
KeyInfoBean keyInfo = new KeyInfoBean(); keyInfo.setCertificate(secToken.getX509Certificate()); keyInfo.setEphemeralKey(secToken.getSecret()); subjectBean = new SubjectBean("", "", ""); subjectBean.setKeyInfo(keyInfo);
Crypto encryptionCrypto ) throws WSSecurityException { KeyInfoBean keyInfo = new KeyInfoBean(); keyInfoElement.appendChild(encryptedKeyElement); keyInfo.setElement(keyInfoElement);
/** * Create a KeyInfoBean that contains an X.509 certificate or Public Key */ protected static KeyInfoBean createPublicKeyKeyInfo(X509Certificate certificate, PublicKey publicKey) { KeyInfoBean keyInfo = new KeyInfoBean(); if (certificate != null) { keyInfo.setCertificate(certificate); keyInfo.setCertIdentifer(CERT_IDENTIFIER.X509_CERT); } else if (publicKey != null) { keyInfo.setPublicKey(publicKey); keyInfo.setCertIdentifer(CERT_IDENTIFIER.KEY_VALUE); } return keyInfo; }
protected KeyInfoBean createKeyInfo() throws Exception { Crypto crypto = CryptoFactory.getInstance("alice.properties"); CryptoType cryptoType = new CryptoType(CryptoType.TYPE.ALIAS); cryptoType.setAlias("alice"); X509Certificate[] certs = crypto.getX509Certificates(cryptoType); KeyInfoBean keyInfo = new KeyInfoBean(); keyInfo.setCertIdentifer(keyInfoIdentifier); if (keyInfoIdentifier == CERT_IDENTIFIER.X509_CERT) { keyInfo.setCertificate(certs[0]); } else if (keyInfoIdentifier == CERT_IDENTIFIER.KEY_VALUE) { keyInfo.setPublicKey(certs[0].getPublicKey()); } return keyInfo; }
protected KeyInfoBean createKeyInfo() throws Exception { Crypto crypto = CryptoFactory.getInstance(cryptoPropertiesFile); CryptoType cryptoType = new CryptoType(CryptoType.TYPE.ALIAS); cryptoType.setAlias(cryptoAlias); X509Certificate[] certs = crypto.getX509Certificates(cryptoType); KeyInfoBean keyInfo = new KeyInfoBean(); keyInfo.setCertIdentifer(keyInfoIdentifier); if (keyInfoIdentifier == CERT_IDENTIFIER.X509_CERT) { keyInfo.setCertificate(certs[0]); } else if (keyInfoIdentifier == CERT_IDENTIFIER.KEY_VALUE) { keyInfo.setPublicKey(certs[0].getPublicKey()); } return keyInfo; }
protected KeyInfoBean createKeyInfo() throws Exception { Crypto crypto = CryptoFactory.getInstance(cryptoPropertiesFile); CryptoType cryptoType = new CryptoType(CryptoType.TYPE.ALIAS); cryptoType.setAlias(cryptoAlias); X509Certificate[] certs = crypto.getX509Certificates(cryptoType); KeyInfoBean keyInfo = new KeyInfoBean(); keyInfo.setCertIdentifer(keyInfoIdentifier); if (keyInfoIdentifier == CERT_IDENTIFIER.X509_CERT) { keyInfo.setCertificate(certs[0]); } else if (keyInfoIdentifier == CERT_IDENTIFIER.KEY_VALUE) { keyInfo.setPublicKey(certs[0].getPublicKey()); } return keyInfo; }