, Javadoc , ( " - " ). [1] synchronized generatePublicKey ( - ) Javadoc, , .
. :
- , Javadoc, , ?
()
Javadoc : " ?" . , , -, ( !), , , , , , ( ). , , , .
[...]
. (), . , . , , Javadoc.
....
, ( , , , KeyFactory, KeyFactory#generatePublic ).
-, KeyFactory.getInstance(String) : [2] [3]
public static KeyFactory getInstance(String algorithm)
throws NoSuchAlgorithmException {
return new KeyFactory(algorithm);
}
:
private KeyFactory(String algorithm) throws NoSuchAlgorithmException {
this.algorithm = algorithm;
List<Service> list = GetInstance.getServices("KeyFactory", algorithm);
serviceIterator = list.iterator();
if (nextSpi(null) == null) {
throw new NoSuchAlgorithmException
(algorithm + " KeyFactory not available");
}
}
nextSpi :
private KeyFactorySpi nextSpi(KeyFactorySpi oldSpi) {
synchronized (lock) {
}
}
KeyFactory#generatePublic :
public final PublicKey generatePublic(KeySpec keySpec)
throws InvalidKeySpecException {
if (serviceIterator == null) {
return spi.engineGeneratePublic(keySpec);
}
}
, , , ( , ) , thread-saftey. , , factory , . .
, , , , , , Javadoc.