當前位置: 首頁>>代碼示例>>Java>>正文


Java RsaSigner類代碼示例

本文整理匯總了Java中org.springframework.security.jwt.crypto.sign.RsaSigner的典型用法代碼示例。如果您正苦於以下問題:Java RsaSigner類的具體用法?Java RsaSigner怎麽用?Java RsaSigner使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


RsaSigner類屬於org.springframework.security.jwt.crypto.sign包,在下文中一共展示了RsaSigner類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: afterPropertiesSet

import org.springframework.security.jwt.crypto.sign.RsaSigner; //導入依賴的package包/類
@Override
public void afterPropertiesSet() throws Exception {
    this.setKeyPair(keyPair);
    PrivateKey privateKey = keyPair.getPrivate();
    signer = new RsaSigner((RSAPrivateKey) privateKey);
    this.setAccessTokenConverter(new DefaultIntrospectionAccessTokenConverter());
}
 
開發者ID:gravitee-io,項目名稱:graviteeio-access-management,代碼行數:8,代碼來源:CustomJwtAccessTokenConverter.java

示例2: setVerifierKey

import org.springframework.security.jwt.crypto.sign.RsaSigner; //導入依賴的package包/類
/**
 * The key used for verifying signatures produced by this class. This is not used but is returned from the endpoint
 * to allow resource servers to obtain the key.
 * 
 * For an HMAC key it will be the same value as the signing key and does not need to be set. For and RSA key, it
 * should be set to the String representation of the public key, in a standard format (e.g. OpenSSH keys)
 * 
 * @param key the signature verification key (typically an RSA public key)
 */
public void setVerifierKey(String key) {
	this.verifierKey = key;
	try {
		new RsaSigner(verifierKey);
		throw new IllegalArgumentException("Private key cannot be set as verifierKey property");
	}
	catch (Exception expected) {
		// Expected
	}
}
 
開發者ID:jungyang,項目名稱:oauth-client-master,代碼行數:20,代碼來源:JwtTokenEnhancer.java

示例3: afterPropertiesSet

import org.springframework.security.jwt.crypto.sign.RsaSigner; //導入依賴的package包/類
@Override
public void afterPropertiesSet() throws Exception {
    keyPair = new KeyStoreKeyFactory(new InputStreamResource(new FileInputStream(new File(configuration.getJks()))),
            configuration.getStorepass().toCharArray()).getKeyPair(configuration.getAlias(), configuration.getKeypass().toCharArray());
    signer = new RsaSigner((RSAPrivateKey) keyPair.getPrivate());
}
 
開發者ID:gravitee-io,項目名稱:graviteeio-access-management,代碼行數:7,代碼來源:JavaKeyStoreProvider.java

示例4: rsaVerificationIsInverseOfSigning

import org.springframework.security.jwt.crypto.sign.RsaSigner; //導入依賴的package包/類
@Test
public void rsaVerificationIsInverseOfSigning() {
	Jwt jwt = JwtHelper.encode(JOE_CLAIM_SEGMENT, new RsaSigner(N, E));
	jwt.verifySignature(new RsaVerifier(N, D));
}
 
開發者ID:jungyang,項目名稱:oauth-client-master,代碼行數:6,代碼來源:JwtTests.java


注:本文中的org.springframework.security.jwt.crypto.sign.RsaSigner類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。