本文整理汇总了Java中java.security.spec.MGF1ParameterSpec.SHA1属性的典型用法代码示例。如果您正苦于以下问题:Java MGF1ParameterSpec.SHA1属性的具体用法?Java MGF1ParameterSpec.SHA1怎么用?Java MGF1ParameterSpec.SHA1使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类java.security.spec.MGF1ParameterSpec
的用法示例。
在下文中一共展示了MGF1ParameterSpec.SHA1属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testGetDigestAlgorithm
/**
* getDigestAlgorithm() method testing.
*/
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "getDigestAlgorithm",
args = {}
)
public void testGetDigestAlgorithm() {
String mdName = "SHA-1";
String mgfName = "MGF1";
AlgorithmParameterSpec mgfSpec = MGF1ParameterSpec.SHA1;
PSource pSrc = PSource.PSpecified.DEFAULT;
OAEPParameterSpec ps = new OAEPParameterSpec(mdName, mgfName,
mgfSpec, pSrc);
assertTrue("The returned value does not equal to the "
+ "value specified in the constructor.",
ps.getDigestAlgorithm().equals(mdName));
}
示例2: testGetMGFAlgorithm
/**
* getMGFAlgorithm() method testing.
*/
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "getMGFAlgorithm",
args = {}
)
public void testGetMGFAlgorithm() {
String mdName = "SHA-1";
String mgfName = "MGF1";
AlgorithmParameterSpec mgfSpec = MGF1ParameterSpec.SHA1;
PSource pSrc = PSource.PSpecified.DEFAULT;
OAEPParameterSpec ps = new OAEPParameterSpec(mdName, mgfName,
mgfSpec, pSrc);
assertTrue("The returned value does not equal to the "
+ "value specified in the constructor.",
ps.getMGFAlgorithm().equals(mgfName));
}
示例3: testGetMGFParameters
/**
* getMGFParameters() method testing.
*/
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "getMGFParameters",
args = {}
)
public void testGetMGFParameters() {
String mdName = "SHA-1";
String mgfName = "MGF1";
AlgorithmParameterSpec mgfSpec = MGF1ParameterSpec.SHA1;
PSource pSrc = PSource.PSpecified.DEFAULT;
OAEPParameterSpec ps = new OAEPParameterSpec(mdName, mgfName,
mgfSpec, pSrc);
assertTrue("The returned value does not equal to the "
+ "value specified in the constructor.",
ps.getMGFParameters() == mgfSpec);
}
示例4: testGetPSource
/**
* getPSource() method testing.
*/
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "getPSource",
args = {}
)
public void testGetPSource() {
String mdName = "SHA-1";
String mgfName = "MGF1";
AlgorithmParameterSpec mgfSpec = MGF1ParameterSpec.SHA1;
PSource pSrc = PSource.PSpecified.DEFAULT;
OAEPParameterSpec ps = new OAEPParameterSpec(mdName, mgfName,
mgfSpec, pSrc);
assertTrue("The returned value does not equal to the "
+ "value specified in the constructor.",
ps.getPSource() == pSrc);
}
示例5: testPSSParameterSpec0201
/**
* Test #1 for
* <code>
* PSSParameterSpec(String,String,AlgorithmParameterSpec,int,int)
* </code> ctor<br>
* Assertion: constructs using valid parameters
* <code>PSSParameterSpec<code> object
*/
@TestTargetNew(
level = TestLevel.PARTIAL_COMPLETE,
notes = "Verifies constructor with valid parameters.",
method = "PSSParameterSpec",
args = {java.lang.String.class, java.lang.String.class, java.security.spec.AlgorithmParameterSpec.class, int.class, int.class}
)
public final void testPSSParameterSpec0201() {
AlgorithmParameterSpec aps = new PSSParameterSpec("SHA-1", "MGF1",
MGF1ParameterSpec.SHA1, 20, 1);
assertTrue(aps instanceof PSSParameterSpec);
}
示例6: testPSSParameterSpec0204
/**
* Test #4 for
* <code>
* PSSParameterSpec(String,String,AlgorithmParameterSpec,int,int)
* </code> ctor<br>
* Assertion:
* throws <code>IllegalArgumentException<code>
* if <code>saltLen<code> less than 0
*/
@TestTargetNew(
level = TestLevel.PARTIAL_COMPLETE,
notes = "Verifies IllegalArgumentException.",
method = "PSSParameterSpec",
args = {java.lang.String.class, java.lang.String.class, java.security.spec.AlgorithmParameterSpec.class, int.class, int.class}
)
public final void testPSSParameterSpec0204() {
try {
new PSSParameterSpec("SHA-1", "MGF1",
MGF1ParameterSpec.SHA1, -20, 1);
fail("Expected IAE not thrown");
} catch (IllegalArgumentException e) {
}
}
示例7: testGetMGFAlgorithm
/**
* Test for <code>getMGFAlgorithm()</code> method
* Assertion: returns mask generation function algorithm name
*/
@TestTargetNew(
level = TestLevel.PARTIAL_COMPLETE,
notes = "Verifies positive case.",
method = "getMGFAlgorithm",
args = {}
)
public final void testGetMGFAlgorithm() {
PSSParameterSpec pssps = new PSSParameterSpec("SHA-1", "MGF1",
MGF1ParameterSpec.SHA1, 20, 1);
assertEquals("MGF1", pssps.getMGFAlgorithm());
}
示例8: testGetPSource
/**
* getPSource() method testing.
*/
public void testGetPSource() {
String mdName = "SHA-1";
String mgfName = "MGF1";
AlgorithmParameterSpec mgfSpec = MGF1ParameterSpec.SHA1;
PSource pSrc = PSource.PSpecified.DEFAULT;
OAEPParameterSpec ps = new OAEPParameterSpec(mdName, mgfName,
mgfSpec, pSrc);
assertTrue("The returned value does not equal to the "
+ "value specified in the constructor.",
ps.getPSource() == pSrc);
}
示例9: testGetMGFAlgorithm
/**
* getMGFAlgorithm() method testing.
*/
public void testGetMGFAlgorithm() {
String mdName = "SHA-1";
String mgfName = "MGF1";
AlgorithmParameterSpec mgfSpec = MGF1ParameterSpec.SHA1;
PSource pSrc = PSource.PSpecified.DEFAULT;
OAEPParameterSpec ps = new OAEPParameterSpec(mdName, mgfName,
mgfSpec, pSrc);
assertTrue("The returned value does not equal to the "
+ "value specified in the constructor.",
ps.getMGFAlgorithm().equals(mgfName));
}
示例10: testGetDigestAlgorithm
/**
* getDigestAlgorithm() method testing.
*/
public void testGetDigestAlgorithm() {
String mdName = "SHA-1";
String mgfName = "MGF1";
AlgorithmParameterSpec mgfSpec = MGF1ParameterSpec.SHA1;
PSource pSrc = PSource.PSpecified.DEFAULT;
OAEPParameterSpec ps = new OAEPParameterSpec(mdName, mgfName,
mgfSpec, pSrc);
assertTrue("The returned value does not equal to the "
+ "value specified in the constructor.",
ps.getDigestAlgorithm().equals(mdName));
}
示例11: testOAEPParameterSpec001
public final void testOAEPParameterSpec001() {
try{ String mdName="";
String mgfName="";
OAEPParameterSpec oaepp= new OAEPParameterSpec(mdName, mgfName, MGF1ParameterSpec.SHA1, PSource.PSpecified.DEFAULT);
if (oaepp instanceof OAEPParameterSpec){
assertTrue(true);
}
else{
assertTrue(false);
}
} catch (Throwable e) {
fail("Should not raise any Exception...");
}
}
示例12: testGetDigestAlgorithm001
public final void testGetDigestAlgorithm001() {
try{ String mdName="jrwtyjq";
String mgfName="";
new PSSParameterSpec(0);
OAEPParameterSpec oaepp= new OAEPParameterSpec(mdName, mgfName, MGF1ParameterSpec.SHA1, PSource.PSpecified.DEFAULT);
assertEquals(mdName,oaepp.getDigestAlgorithm());
} catch (Throwable e) {
fail("Should not raise any Exception...");
}
}
示例13: testGetMGFAlgorithm001
public final void testGetMGFAlgorithm001() {
try{ String mdName="jrwtyjq";
String mgfName="n8yuifg57";
new PSSParameterSpec(0);
OAEPParameterSpec oaepp= new OAEPParameterSpec(mdName, mgfName, MGF1ParameterSpec.SHA1, PSource.PSpecified.DEFAULT);
assertEquals(mgfName,oaepp.getMGFAlgorithm());
} catch (Throwable e) {
fail("Should not raise any Exception...");
}
}
示例14: testGetMGFAlgorithm002
public final void testGetMGFAlgorithm002() {
try{ String mdName="jrwtyjq";
String mgfName="";
new PSSParameterSpec(0);
OAEPParameterSpec oaepp= new OAEPParameterSpec(mdName, mgfName, MGF1ParameterSpec.SHA1, PSource.PSpecified.DEFAULT);
assertEquals(mgfName,oaepp.getMGFAlgorithm());
} catch (Throwable e) {
fail("Should not raise any Exception...");
}
}
示例15: testGetPSource001
public final void testGetPSource001() {
try{ String mdName="jy5w";
String mgfName="ter";
OAEPParameterSpec oaepp= new OAEPParameterSpec(mdName, mgfName, MGF1ParameterSpec.SHA1, PSource.PSpecified.DEFAULT);
assertEquals(PSource.PSpecified.DEFAULT,oaepp.getPSource());
} catch (Throwable e) {
fail("Should not raise any Exception...");
}
}