本文整理汇总了Java中java.security.cert.PolicyQualifierInfo.getEncoded方法的典型用法代码示例。如果您正苦于以下问题:Java PolicyQualifierInfo.getEncoded方法的具体用法?Java PolicyQualifierInfo.getEncoded怎么用?Java PolicyQualifierInfo.getEncoded使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.security.cert.PolicyQualifierInfo
的用法示例。
在下文中一共展示了PolicyQualifierInfo.getEncoded方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testPolicyQualifierInfo04
import java.security.cert.PolicyQualifierInfo; //导入方法依赖的package包/类
/**
* Test #4 for <code>PolicyQualifierInfo</code> constructor<br>
* Assertion: The encoded byte array is copied on construction
*
* @throws IOException
*/
@TestTargetNew(
level = TestLevel.PARTIAL_COMPLETE,
notes = "Verifies constructor with encoded byte array copied on construction.",
method = "PolicyQualifierInfo",
args = {byte[].class}
)
public final void testPolicyQualifierInfo04() throws IOException {
// get valid encoding
byte[] encoding = getDerEncoding();
byte[] encodingCopy = encoding.clone();
// pass valid array
PolicyQualifierInfo i = new PolicyQualifierInfo(encodingCopy);
// get encoding
byte[] encodingRet = i.getEncoded();
// check returned array
assertTrue(Arrays.equals(encoding, encodingRet));
// modify input
encodingCopy[0] = (byte)0;
// get encoding again
byte[] encodingRet1 = i.getEncoded();
// check that above modification did not change
// internal state of the PolicyQualifierInfo instance
assertTrue(Arrays.equals(encoding, encodingRet1));
}
示例2: testGetEncoded01
import java.security.cert.PolicyQualifierInfo; //导入方法依赖的package包/类
/**
* Test #1 for <code>getEncoded()</code> method
* Assertion: Returns the ASN.1 DER encoded form of
* this <code>PolicyQualifierInfo</code>
*
* @throws IOException
*/
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "getEncoded",
args = {}
)
public final void testGetEncoded01() throws IOException {
// get valid encoding
byte[] encoding = getDerEncoding();
// pass valid array
PolicyQualifierInfo i = new PolicyQualifierInfo(encoding);
// get encoding
byte[] encodingRet = i.getEncoded();
// check returned array
assertTrue(Arrays.equals(encoding, encodingRet));
}
示例3: testGetEncoded02
import java.security.cert.PolicyQualifierInfo; //导入方法依赖的package包/类
/**
* Test #2 for <code>getEncoded()</code> method
* Assertion: a copy is returned each time
*
* @throws IOException
*/
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "getEncoded",
args = {}
)
public final void testGetEncoded02() throws IOException {
// get valid encoding
byte[] encoding = getDerEncoding();
byte[] encodingCopy = encoding.clone();
// pass valid array
PolicyQualifierInfo i = new PolicyQualifierInfo(encodingCopy);
// get encoding
byte[] encodingRet = i.getEncoded();
// modify returned array
encodingRet[0] = (byte)0;
// get encoding again
byte[] encodingRet1 = i.getEncoded();
// check that above modification did not change
// internal state of the PolicyQualifierInfo instance
assertTrue(Arrays.equals(encoding, encodingRet1));
}
示例4: testPolicyQualifierInfo04
import java.security.cert.PolicyQualifierInfo; //导入方法依赖的package包/类
/**
* Test #4 for <code>PolicyQualifierInfo</code> constructor<br>
* Assertion: The encoded byte array is copied on construction
*
* @throws IOException
*/
public final void testPolicyQualifierInfo04() throws IOException {
// get valid encoding
byte[] encoding = getDerEncoding();
byte[] encodingCopy = encoding.clone();
// pass valid array
PolicyQualifierInfo i = new PolicyQualifierInfo(encodingCopy);
// get encoding
byte[] encodingRet = i.getEncoded();
// check returned array
assertTrue(Arrays.equals(encoding, encodingRet));
// modify input
encodingCopy[0] = (byte)0;
// get encoding again
byte[] encodingRet1 = i.getEncoded();
// check that above modification did not change
// internal state of the PolicyQualifierInfo instance
assertTrue(Arrays.equals(encoding, encodingRet1));
}
示例5: testGetEncoded02
import java.security.cert.PolicyQualifierInfo; //导入方法依赖的package包/类
/**
* Test #2 for <code>getEncoded()</code> method
* Assertion: a copy is returned each time
*
* @throws IOException
*/
public final void testGetEncoded02() throws IOException {
// get valid encoding
byte[] encoding = getDerEncoding();
byte[] encodingCopy = encoding.clone();
// pass valid array
PolicyQualifierInfo i = new PolicyQualifierInfo(encodingCopy);
// get encoding
byte[] encodingRet = i.getEncoded();
// modify returned array
encodingRet[0] = (byte)0;
// get encoding again
byte[] encodingRet1 = i.getEncoded();
// check that above modification did not change
// internal state of the PolicyQualifierInfo instance
assertTrue(Arrays.equals(encoding, encodingRet1));
}
示例6: testGetEncoded01
import java.security.cert.PolicyQualifierInfo; //导入方法依赖的package包/类
/**
* Test #1 for <code>getEncoded()</code> method
* Assertion: Returns the ASN.1 DER encoded form of
* this <code>PolicyQualifierInfo</code>
*
* @throws IOException
*/
public final void testGetEncoded01() throws IOException {
// get valid encoding
byte[] encoding = getDerEncoding();
// pass valid array
PolicyQualifierInfo i = new PolicyQualifierInfo(encoding);
// get encoding
byte[] encodingRet = i.getEncoded();
// check returned array
assertTrue(Arrays.equals(encoding, encodingRet));
}