jdk/src/share/classes/sun/security/x509/RDN.java
changeset 10336 0bb1999251f8
parent 5506 202f599c92aa
equal deleted inserted replaced
10335:3c7eda3ab2f5 10336:0bb1999251f8
     1 /*
     1 /*
     2  * Copyright (c) 2002, 2006, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    23  * questions.
    23  * questions.
    24  */
    24  */
    25 
    25 
    26 package sun.security.x509;
    26 package sun.security.x509;
    27 
    27 
    28 import java.lang.reflect.*;
       
    29 import java.io.IOException;
    28 import java.io.IOException;
    30 import java.io.StringReader;
    29 import java.io.StringReader;
    31 import java.security.PrivilegedExceptionAction;
       
    32 import java.security.AccessController;
       
    33 import java.security.Principal;
       
    34 import java.util.*;
    30 import java.util.*;
    35 
    31 
    36 import sun.security.util.*;
    32 import sun.security.util.*;
    37 import sun.security.pkcs.PKCS9Attribute;
       
    38 import javax.security.auth.x500.X500Principal;
       
    39 
    33 
    40 /**
    34 /**
    41  * RDNs are a set of {attribute = value} assertions.  Some of those
    35  * RDNs are a set of {attribute = value} assertions.  Some of those
    42  * attributes are "distinguished" (unique w/in context).  Order is
    36  * attributes are "distinguished" (unique w/in context).  Order is
    43  * never relevant.
    37  * never relevant.
   325      * @params oid ObjectIdentifier of attribute to be found
   319      * @params oid ObjectIdentifier of attribute to be found
   326      * @returns DerValue of attribute value; null if attribute does not exist
   320      * @returns DerValue of attribute value; null if attribute does not exist
   327      */
   321      */
   328     DerValue findAttribute(ObjectIdentifier oid) {
   322     DerValue findAttribute(ObjectIdentifier oid) {
   329         for (int i = 0; i < assertion.length; i++) {
   323         for (int i = 0; i < assertion.length; i++) {
   330             if (assertion[i].oid.equals(oid)) {
   324             if (assertion[i].oid.equals((Object)oid)) {
   331                 return assertion[i].value;
   325                 return assertion[i].value;
   332             }
   326             }
   333         }
   327         }
   334         return null;
   328         return null;
   335     }
   329     }