Package javax.crypto.spec

Examples of javax.crypto.spec.PSource$PSpecified


                    if (!mgfName.equalsIgnoreCase("MGF1")) {
                        throw new InvalidAlgorithmParameterException
                            ("Unsupported MGF algo: " + mgfName);
                    }
                    mgfMdName = ((MGF1ParameterSpec)spec.getMGFParameters()).getDigestAlgorithm();
                    PSource pSrc = spec.getPSource();
                    String pSrcAlgo = pSrc.getAlgorithm();
                    if (!pSrcAlgo.equalsIgnoreCase("PSpecified")) {
                        throw new InvalidAlgorithmParameterException
                            ("Unsupported pSource algo: " + pSrcAlgo);
                    }
                    digestInput = ((PSource.PSpecified) pSrc).getValue();
View Full Code Here


     * PSource(String pSrcName) method testing. Tests that returned value is
     * equal to the value specified in the constructor.
     */
    public void testPSource() {
        try {
            new PSource(null);
            fail("NullPointerException should be thrown in the case of "
                    + "null pSrcName.");
        } catch (NullPointerException e) {
        }
    }
View Full Code Here

     * getAlgorithm() method testing. Tests that returned value is
     * equal to the value specified in the constructor.
     */
    public void testGetAlgorithm() {
        String pSrcName = "pSrcName";
        PSource ps = new PSource(pSrcName);
        assertTrue("The returned value is not equal to the value specified "
                + "in constructor", pSrcName.equals(ps.getAlgorithm()));
    }
View Full Code Here

    public void testOAEPParameterSpec() {
        // using init values for OAEPParameterSpec.DEFAULT
        String mdName = "SHA-1";
        String mgfName = "MGF1";
        AlgorithmParameterSpec mgfSpec = MGF1ParameterSpec.SHA1;
        PSource pSrc = PSource.PSpecified.DEFAULT;

        try {
            new OAEPParameterSpec(null, mgfName, mgfSpec, pSrc);
            fail("NullPointerException should be thrown in the case of "
                    + "null mdName.");
View Full Code Here

     */
    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.",
View Full Code Here

     */
    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.",
View Full Code Here

     */
    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.",
View Full Code Here

    public void testOAEPParameterSpec() {
        // using init values for OAEPParameterSpec.DEFAULT
        String mdName = "SHA-1";
        String mgfName = "MGF1";
        AlgorithmParameterSpec mgfSpec = MGF1ParameterSpec.SHA1;
        PSource pSrc = PSource.PSpecified.DEFAULT;

        try {
            new OAEPParameterSpec(null, mgfName, mgfSpec, pSrc);
            fail("NullPointerException should be thrown in the case of "
                    + "null mdName.");
View Full Code Here

     */
    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.",
View Full Code Here

     */
    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.",
View Full Code Here

TOP

Related Classes of javax.crypto.spec.PSource$PSpecified

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.