Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions jsign-crypto/src/main/java/net/jsign/YubiKey.java
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,24 @@ static File getYkcs11Library() {
return libykcs11;

} else if (osname.contains("Mac")) {
List<String> paths = new ArrayList<>();
paths.add("/opt/homebrew/lib/libykcs11.dylib");
paths.add("/usr/local/lib/libykcs11.dylib");

String dyldLibraryPath = System.getenv("DYLD_LIBRARY_PATH");
if (dyldLibraryPath != null) {
for (String s : dyldLibraryPath.split(":")) {
paths.add(s + "/libykcs11.dylib");
}
}

for (String path : paths) {
File libykcs11 = new File(path);
if (libykcs11.exists()) {
return libykcs11;
}
}

return new File("/usr/local/lib/libykcs11.dylib");

} else {
Expand Down