Package java.security

Examples of java.security.UnresolvedPermission


                .getInstance("X.509");
        Certificate certificate = certificateFactory
                .generateCertificate(new ByteArrayInputStream(TestUtils
                        .getEncodedX509Certificate()));

        UnresolvedPermission unresolvedPermission = new UnresolvedPermission(
                "java.security.SecurityPermission", "a.b.c", "action",
                new Certificate[] { certificate });
        SerializationTest.verifySelf(unresolvedPermission);
        SerializationTest.verifyGolden(this, unresolvedPermission);
    }
View Full Code Here


    /**
     * Return array holding 3 collections: empty, single- and multi-element.
     */
    protected Object[] getData() {
        Permission up1 = new UnresolvedPermission("131234", null, null, null);
        Permission up2 = new UnresolvedPermission("131234", "ui23rjh", null,
                null);
        Permission up3 = new UnresolvedPermission("KUJKHVKJgyuygjhb", "xcv456",
                "26r ytf", new java.security.cert.Certificate[0]);
        PermissionCollection pc1 = up1.newPermissionCollection();
        PermissionCollection pc2 = up1.newPermissionCollection();
        pc2.add(up3);
        PermissionCollection pc3 = up1.newPermissionCollection();
View Full Code Here

        for (Iterator i = grantedPermissions.listIterator(); i.hasNext();) {
            Permissions.Permission p = (Permissions.Permission) i.next();
            if (p.getClassName() == null) {
                throw new BuildException("Granted permission " + p + " does not contain a class.");
            } else {
                java.security.Permission perm =  new UnresolvedPermission(p.getClassName(),p.getName(),p.getActions(),null);
                granted.add(perm);
            }
        }
        // Add base set of permissions
        granted.add(new java.net.SocketPermission("localhost:1024-", "listen"));
View Full Code Here

      }
      Class cl;
      try {
    cl = Class.forName(pi.type);
      } catch (ClassNotFoundException ex) {
    l.add(new UnresolvedPermission(
        pi.type, pi.name, pi.actions, null));
    continue;
      }
      if (!Permission.class.isAssignableFrom(cl)) {
    throw new IllegalArgumentException(
View Full Code Here

                        certs = null;

                    // only add if we had no signer or we had a
                    // a signer and found the keys for it.
                    if (certs != null || pe.signedBy == null) {
                            Permission perm = new UnresolvedPermission(
                                             pe.permission,
                                             pe.name,
                                             pe.action,
                                             certs);
                            entry.add(perm);
View Full Code Here

        f = new File(System.getProperty("test.src", "."), SIGNER2);
        fis = new FileInputStream(f);
        Certificate signer2 = fac.generateCertificate(fis);
        signercerts[2] = signer2;

        UnresolvedPermission up = new UnresolvedPermission
                        ("type", "name", "actions", signercerts);
        if (!up.getUnresolvedType().equals("type") ||
            !up.getUnresolvedName().equals("name") ||
            !up.getUnresolvedActions().equals("actions")) {
            throw new SecurityException("Test 1 Failed");
        }

        Certificate[] certs = up.getUnresolvedCerts();
        if (certs == null || certs.length != 2) {
            throw new SecurityException("Test 2 Failed");
        }

        boolean foundSigner1 = false;
View Full Code Here

                        pe.actions);
            }
        }
        catch (ClassNotFoundException cnfe) {}
        //maybe properly signed class will be loaded later
        return new UnresolvedPermission(pe.klass, pe.name, pe.actions, signers);
    }
View Full Code Here

                        pe.actions);
            }
        }
        catch (ClassNotFoundException cnfe) {}
        //maybe properly signed class will be loaded later
        return new UnresolvedPermission(pe.klass, pe.name, pe.actions, signers);
    }
View Full Code Here

    private Permission createUnresolvedPermission( final String type,
                                                   final String target,
                                                   final String actions,
                                                   final Certificate[] signers )
    {
        return new UnresolvedPermission( type, target, actions, signers );
    }
View Full Code Here

                        pe.actions);
            }
        }
        catch (ClassNotFoundException cnfe) {}
        //maybe properly signed class will be loaded later
        return new UnresolvedPermission(pe.klass, pe.name, pe.actions, signers);
    }
View Full Code Here

TOP

Related Classes of java.security.UnresolvedPermission

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.