当前位置: 首页>>代码示例>>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;未经允许,请勿转载。