当前位置: 首页>>代码示例>>Java>>正文


Java MGF1ParameterSpec.SHA1属性代码示例

本文整理汇总了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));
}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:21,代码来源:OAEPParameterSpecTest.java

示例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));
}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:21,代码来源:OAEPParameterSpecTest.java

示例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);
}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:21,代码来源:OAEPParameterSpecTest.java

示例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);
}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:21,代码来源:OAEPParameterSpecTest.java

示例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);
}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:19,代码来源:PSSParameterSpecTest.java

示例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) {
    }
}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:23,代码来源:PSSParameterSpecTest.java

示例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());
}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:15,代码来源:PSSParameterSpecTest.java

示例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);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:15,代码来源:OAEPParameterSpecTest.java

示例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));
}
 
开发者ID:shannah,项目名称:cn1,代码行数:15,代码来源:OAEPParameterSpecTest.java

示例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));
}
 
开发者ID:shannah,项目名称:cn1,代码行数:15,代码来源:OAEPParameterSpecTest.java

示例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...");
    }
}
 
开发者ID:freeVM,项目名称:freeVM,代码行数:15,代码来源:TestOAEPParameterSpec.java

示例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...");
    }
}
 
开发者ID:freeVM,项目名称:freeVM,代码行数:10,代码来源:TestOAEPParameterSpec.java

示例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...");
}
}
 
开发者ID:freeVM,项目名称:freeVM,代码行数:10,代码来源:TestOAEPParameterSpec.java

示例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...");
}
}
 
开发者ID:freeVM,项目名称:freeVM,代码行数:10,代码来源:TestOAEPParameterSpec.java

示例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...");
    }
}
 
开发者ID:freeVM,项目名称:freeVM,代码行数:9,代码来源:TestOAEPParameterSpec.java


注:本文中的java.security.spec.MGF1ParameterSpec.SHA1属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。