523 }
524 }
525 return false;
526 }
527
528 private static final Map<String,String[]> osMap;
529
530 // Location of the NSS libraries on each supported platform
531 static {
532 osMap = new HashMap<String,String[]>();
533 osMap.put("SunOS-sparc-32", new String[]{"/usr/lib/mps/"});
534 osMap.put("SunOS-sparcv9-64", new String[]{"/usr/lib/mps/64/"});
535 osMap.put("SunOS-x86-32", new String[]{"/usr/lib/mps/"});
536 osMap.put("SunOS-amd64-64", new String[]{"/usr/lib/mps/64/"});
537 osMap.put("Linux-i386-32", new String[]{
538 "/usr/lib/i386-linux-gnu/", "/usr/lib32/", "/usr/lib/"});
539 osMap.put("Linux-amd64-64", new String[]{
540 "/usr/lib/x86_64-linux-gnu/", "/usr/lib/x86_64-linux-gnu/nss/",
541 "/usr/lib64/"});
542 osMap.put("Linux-ppc64-64", new String[]{"/usr/lib64/"});
543 osMap.put("Windows-x86-32", new String[]{
544 PKCS11_BASE + "/nss/lib/windows-i586/".replace('/', SEP)});
545 osMap.put("Windows-amd64-64", new String[]{
546 PKCS11_BASE + "/nss/lib/windows-amd64/".replace('/', SEP)});
547 osMap.put("MacOSX-x86_64-64", new String[]{
548 PKCS11_BASE + "/nss/lib/macosx-x86_64/"});
549 }
550
551 private final static char[] hexDigits = "0123456789abcdef".toCharArray();
552
553 public static String toString(byte[] b) {
554 if (b == null) {
555 return "(null)";
556 }
557 StringBuffer sb = new StringBuffer(b.length * 3);
558 for (int i = 0; i < b.length; i++) {
559 int k = b[i] & 0xff;
560 if (i != 0) {
561 sb.append(':');
562 }
|
523 }
524 }
525 return false;
526 }
527
528 private static final Map<String,String[]> osMap;
529
530 // Location of the NSS libraries on each supported platform
531 static {
532 osMap = new HashMap<String,String[]>();
533 osMap.put("SunOS-sparc-32", new String[]{"/usr/lib/mps/"});
534 osMap.put("SunOS-sparcv9-64", new String[]{"/usr/lib/mps/64/"});
535 osMap.put("SunOS-x86-32", new String[]{"/usr/lib/mps/"});
536 osMap.put("SunOS-amd64-64", new String[]{"/usr/lib/mps/64/"});
537 osMap.put("Linux-i386-32", new String[]{
538 "/usr/lib/i386-linux-gnu/", "/usr/lib32/", "/usr/lib/"});
539 osMap.put("Linux-amd64-64", new String[]{
540 "/usr/lib/x86_64-linux-gnu/", "/usr/lib/x86_64-linux-gnu/nss/",
541 "/usr/lib64/"});
542 osMap.put("Linux-ppc64-64", new String[]{"/usr/lib64/"});
543 osMap.put("Linux-ppc64le-64", new String[]{"/usr/lib64/"});
544 osMap.put("Windows-x86-32", new String[]{
545 PKCS11_BASE + "/nss/lib/windows-i586/".replace('/', SEP)});
546 osMap.put("Windows-amd64-64", new String[]{
547 PKCS11_BASE + "/nss/lib/windows-amd64/".replace('/', SEP)});
548 osMap.put("MacOSX-x86_64-64", new String[]{
549 PKCS11_BASE + "/nss/lib/macosx-x86_64/"});
550 }
551
552 private final static char[] hexDigits = "0123456789abcdef".toCharArray();
553
554 public static String toString(byte[] b) {
555 if (b == null) {
556 return "(null)";
557 }
558 StringBuffer sb = new StringBuffer(b.length * 3);
559 for (int i = 0; i < b.length; i++) {
560 int k = b[i] & 0xff;
561 if (i != 0) {
562 sb.append(':');
563 }
|