- java.lang.Object
-
- com.zerodeplibs.webpush.VAPIDKeyPairs
-
public class VAPIDKeyPairs extends Object
Static factory methods used to create instances of
VAPIDKeyPair.Thread Safety:-
Instances obtained through
of(PrivateKeySource, PublicKeySource, BiFunction)are thread-safe only if an instance obtained fromjwtGeneratorFactoryis thread-safe. -
If you use
of(PrivateKeySource, PublicKeySource)without sub-modules forVAPIDJWTGenerator, obtained instances are thread-safe. Because the default implementation ofVAPIDJWTGeneratoris thread-safe. -
If you use
of(PrivateKeySource, PublicKeySource)with a sub-module provided by zerodep-web-push-java-ext-jwt, obtained instances are thread-safe.
- Author:
- Tomoki Sato
-
Instances obtained through
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static VAPIDKeyPairof(PrivateKeySource privateKeySource, PublicKeySource publicKeySource)Creates a newVAPIDKeyPairwith the given private key source and the given public key source.static VAPIDKeyPairof(PrivateKeySource privateKeySource, PublicKeySource publicKeySource, BiFunction<ECPrivateKey,ECPublicKey,VAPIDJWTGenerator> jwtGeneratorFactory)Creates a newVAPIDKeyPairwith the given private key source, the given public key source and the given factory forVAPIDJWTGenerator.
-
-
-
Method Detail
-
of
public static VAPIDKeyPair of(PrivateKeySource privateKeySource, PublicKeySource publicKeySource, BiFunction<ECPrivateKey,ECPublicKey,VAPIDJWTGenerator> jwtGeneratorFactory)
Creates a newVAPIDKeyPairwith the given private key source, the given public key source and the given factory forVAPIDJWTGenerator.- Parameters:
privateKeySource- a private key source.publicKeySource- a public key source.jwtGeneratorFactory- a factory forVAPIDJWTGenerator.- Returns:
- a new
VAPIDKeyPair - Throws:
InvalidECPublicKeyException- if the public key extracted from the given public key source is invalid.
-
of
public static VAPIDKeyPair of(PrivateKeySource privateKeySource, PublicKeySource publicKeySource)
Creates a new
VAPIDKeyPairwith the given private key source and the given public key source.The implementation of
VAPIDJWTGeneratorcan be provided by one of the sub-modules (zerodep-web-push-java-ext-jwt) on your classpath. If such sub-modules don't exist, the default implementation (created byDefaultVAPIDJWTGeneratorFactory) is used.- Parameters:
privateKeySource- a private key source.publicKeySource- a public key source.- Returns:
- a new
VAPIDKeyPair - Throws:
InvalidECPublicKeyException- if the public key extracted from the given public key source is invalid.- See Also:
DefaultVAPIDJWTGeneratorFactory
-
-