本文整理汇总了Java中org.bouncycastle.asn1.x500.X500NameStyle类的典型用法代码示例。如果您正苦于以下问题:Java X500NameStyle类的具体用法?Java X500NameStyle怎么用?Java X500NameStyle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
X500NameStyle类属于org.bouncycastle.asn1.x500包,在下文中一共展示了X500NameStyle类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: performTest
import org.bouncycastle.asn1.x500.X500NameStyle; //导入依赖的package包/类
public void performTest()
throws Exception
{
X500NameStyle style = RFC4519Style.INSTANCE;
for (int i = 0; i != attributeTypes.length; i++)
{
if (!attributeTypeOIDs[i].equals(style.attrNameToOID(attributeTypes[i])))
{
fail("mismatch for " + attributeTypes[i]);
}
}
byte[] enc = Hex.decode("305e310b300906035504061302415531283026060355040a0c1f546865204c6567696f6e206f662074686520426f756e637920436173746c653125301006035504070c094d656c626f75726e653011060355040b0c0a4173636f742056616c65");
X500Name n = X500Name.getInstance(style, X500Name.getInstance(enc));
if (!n.toString().equals("l=Melbourne+ou=Ascot Vale,o=The Legion of the Bouncy Castle,c=AU"))
{
fail("Failed composite to string test got: " + n.toString());
}
n = new X500Name(style, "l=Melbourne+ou=Ascot Vale,o=The Legion of the Bouncy Castle,c=AU");
if (!Arrays.areEqual(n.getEncoded(), enc))
{
fail("re-encoding test after parse failed");
}
}
开发者ID:ttt43ttt,项目名称:gwt-crypto,代码行数:30,代码来源:RFC4519Test.java
示例2: authorize
import org.bouncycastle.asn1.x500.X500NameStyle; //导入依赖的package包/类
@Override
public boolean authorize(String dn, String operation, String resource) {
boolean authorized = config.getAccessControlList().isAuthorized(dn, operation, resource);
if (log.isInfoEnabled()) {
StringBuilder sb = new StringBuilder();
if (authorized) {
sb.append("Authorized: ");
}
else {
sb.append("Rejected: ");
}
if (Strings.isNullOrEmpty(dn)) {
sb.append("<null DN>");
}
else {
X500NameStyle x500NameStyle = ExtendedRFC4519Style.INSTANCE;
X500Name principal = new X500Name(dn);
sb.append(x500NameStyle.toString(principal));
}
sb.append(", ");
sb.append(operation);
sb.append(" ");
sb.append(resource);
log.info(sb.toString());
}
return authorized;
}
开发者ID:BandwidthOnDemand,项目名称:nsi-dds,代码行数:33,代码来源:DnAuthorizationProvider.java
示例3: performTest
import org.bouncycastle.asn1.x500.X500NameStyle; //导入依赖的package包/类
@Test
public void performTest() throws Exception
{
X500NameStyle style = ExtendedRFC4519Style.INSTANCE;
for (int i = 0; i != attributeTypes.length; i++)
{
if (!attributeTypeOIDs[i].equals(style.attrNameToOID(attributeTypes[i])))
{
fail("mismatch for " + attributeTypes[i]);
}
}
byte[] enc = Hex.decode("305e310b300906035504061302415531283026060355040a0c1f546865204c6567696f6e206f662074686520426f756e637920436173746c653125301006035504070c094d656c626f75726e653011060355040b0c0a4173636f742056616c65");
X500Name n = new X500Name(style, X500Name.getInstance(enc));
if (!n.toString().equals("l=Melbourne+ou=Ascot Vale,o=The Legion of the Bouncy Castle,c=AU"))
{
fail("Failed composite to string test got: " + n.toString());
}
n = new X500Name(style, "l=Melbourne+ou=Ascot Vale,o=The Legion of the Bouncy Castle,c=AU");
if (!Arrays.areEqual(n.getEncoded(), enc))
{
fail("re-encoding test after parse failed");
}
}
开发者ID:BandwidthOnDemand,项目名称:nsi-dds,代码行数:30,代码来源:ExtendedRFC4519Test.java
示例4: getIssuer
import org.bouncycastle.asn1.x500.X500NameStyle; //导入依赖的package包/类
public static X500Name getIssuer(X500NameStyle style, X509Certificate certificate)
{
try
{
return X500Name.getInstance(style, PrincipalUtil.getIssuerX509Principal(certificate).getEncoded());
}
catch (Exception e)
{
throw new IllegalStateException(e.toString());
}
}
开发者ID:credentials,项目名称:irma_future_id,代码行数:12,代码来源:JcaX500NameUtil.java
示例5: getSubject
import org.bouncycastle.asn1.x500.X500NameStyle; //导入依赖的package包/类
public static X500Name getSubject(X500NameStyle style, X509Certificate certificate)
{
try
{
return X500Name.getInstance(style, PrincipalUtil.getSubjectX509Principal(certificate).getEncoded());
}
catch (Exception e)
{
throw new IllegalStateException(e.toString());
}
}
开发者ID:credentials,项目名称:irma_future_id,代码行数:12,代码来源:JcaX500NameUtil.java
示例6: performTest
import org.bouncycastle.asn1.x500.X500NameStyle; //导入依赖的package包/类
public void performTest()
throws Exception
{
X500NameStyle style = RFC4519Style.INSTANCE;
for (int i = 0; i != attributeTypes.length; i++)
{
if (!attributeTypeOIDs[i].equals(style.attrNameToOID(attributeTypes[i])))
{
fail("mismatch for " + attributeTypes[i]);
}
}
byte[] enc = Hex.decode("305e310b300906035504061302415531283026060355040a0c1f546865204c6567696f6e206f662074686520426f756e637920436173746c653125301006035504070c094d656c626f75726e653011060355040b0c0a4173636f742056616c65");
X500Name n = new X500Name(style, X500Name.getInstance(enc));
if (!n.toString().equals("l=Melbourne+ou=Ascot Vale,o=The Legion of the Bouncy Castle,c=AU"))
{
fail("Failed composite to string test got: " + n.toString());
}
n = new X500Name(style, "l=Melbourne+ou=Ascot Vale,o=The Legion of the Bouncy Castle,c=AU");
if (!Arrays.areEqual(n.getEncoded(), enc))
{
fail("re-encoding test after parse failed");
}
}
开发者ID:credentials,项目名称:irma_future_id,代码行数:30,代码来源:RFC4519Test.java
示例7: getIssuer
import org.bouncycastle.asn1.x500.X500NameStyle; //导入依赖的package包/类
public static X500Name getIssuer(X500NameStyle style, X509Certificate certificate)
{
return X500Name.getInstance(style, certificate.getIssuerX500Principal().getEncoded());
}
开发者ID:Appdome,项目名称:ipack,代码行数:5,代码来源:JcaX500NameUtil.java
示例8: getSubject
import org.bouncycastle.asn1.x500.X500NameStyle; //导入依赖的package包/类
public static X500Name getSubject(X500NameStyle style, X509Certificate certificate)
{
return X500Name.getInstance(style, certificate.getSubjectX500Principal().getEncoded());
}
开发者ID:Appdome,项目名称:ipack,代码行数:5,代码来源:JcaX500NameUtil.java
注:本文中的org.bouncycastle.asn1.x500.X500NameStyle类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论