Package com.yoti.api.client
Class UrlKeyPairSource
java.lang.Object
com.yoti.api.client.UrlKeyPairSource
- All Implemented Interfaces:
KeyPairSource
Responsible for getting key pairs from a URL.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.yoti.api.client.KeyPairSource
KeyPairSource.StreamVisitor -
Method Summary
Modifier and TypeMethodDescriptionstatic UrlKeyPairSourcefinal KeyPairgetFromStream(KeyPairSource.StreamVisitor streamVisitor) Parse stream held using the StreamVisitor and return the KeyPair instance.protected InputStreamReturn stream held by the source.protected booleanOverride this to prevent the stream from closing.
-
Method Details
-
fromUrl
- Throws:
InitialisationException
-
getStream
Return stream held by the source. Expected to return the same instance every time.- Returns:
- stream instance
-
getFromStream
public final KeyPair getFromStream(KeyPairSource.StreamVisitor streamVisitor) throws IOException, InitialisationException Description copied from interface:KeyPairSourceParse stream held using the StreamVisitor and return the KeyPair instance.- Specified by:
getFromStreamin interfaceKeyPairSource- Parameters:
streamVisitor- visitor handling the actual parsing from the stream- Returns:
- key pair
- Throws:
IOException- signals issues during stream operationsInitialisationException- if the key pair could not be loaded
-
shouldClose
protected boolean shouldClose()Override this to prevent the stream from closing.- Returns:
- true if the stream should not be closed
-