本文整理汇总了Java中javax.xml.crypto.dsig.keyinfo.KeyName类的典型用法代码示例。如果您正苦于以下问题:Java KeyName类的具体用法?Java KeyName怎么用?Java KeyName使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
KeyName类属于javax.xml.crypto.dsig.keyinfo包,在下文中一共展示了KeyName类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: select_wrong_structType
import javax.xml.crypto.dsig.keyinfo.KeyName; //导入依赖的package包/类
@Test()
public void select_wrong_structType() throws Exception {
// given
KeyInfo keyinfo = mock(KeyInfo.class);
ArrayList<XMLStructure> list = new ArrayList<XMLStructure>();
KeyName struct = mock(KeyName.class);
list.add(struct);
doReturn(list).when(keyinfo).getContent();
// when
try {
selector.select(keyinfo, null, null, null);
fail();
} catch (KeySelectorException e) {
assertTrue(e.getMessage().contains("No X509Data element found."));
}
}
示例2: select_wrong_structType
import javax.xml.crypto.dsig.keyinfo.KeyName; //导入依赖的package包/类
@Test()
public void select_wrong_structType() throws Exception {
// given
KeyInfo keyinfo = mock(KeyInfo.class);
ArrayList<XMLStructure> list = new ArrayList<XMLStructure>();
KeyName struct = mock(KeyName.class);
list.add(struct);
doReturn(list).when(keyinfo).getContent();
// when
try {
selector.select(keyinfo, null, null, null);
fail();
} catch (KeySelectorException e) {
assertTrue(e.getMessage().contains(
"No RSA/DSA KeyValue element found"));
}
}
示例3: equals
import javax.xml.crypto.dsig.keyinfo.KeyName; //导入依赖的package包/类
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof KeyName)) {
return false;
}
KeyName okn = (KeyName)obj;
return name.equals(okn.getName());
}
示例4: equals
import javax.xml.crypto.dsig.keyinfo.KeyName; //导入依赖的package包/类
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof KeyName)) {
return false;
}
KeyName okn = (KeyName) obj;
return name.equals(okn.getName());
}
示例5: marshalObject
import javax.xml.crypto.dsig.keyinfo.KeyName; //导入依赖的package包/类
@Override
public void marshalObject(XmlWriter xwriter, KeyName toMarshal, String dsPrefix,
XMLCryptoContext context) throws MarshalException {
Marshaller.marshalKeyName(xwriter, toMarshal, dsPrefix);
}
示例6: marshalKeyName
import javax.xml.crypto.dsig.keyinfo.KeyName; //导入依赖的package包/类
/**
* Marshals a {@link KeyName}.
*
* @param xwriter
* @param keyName
* @param dsPrefix
*/
public static void marshalKeyName(XmlWriter xwriter, KeyName keyName, String dsPrefix) {
xwriter.writeTextElement(dsPrefix, "KeyName", XMLSignature.XMLNS, keyName.getName());
}