當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。