Package com.yoti.api.client
Class InputStreamKeyPairSource
java.lang.Object
com.yoti.api.client.InputStreamKeyPairSource
- All Implemented Interfaces:
KeyPairSource
Responsible for getting key pairs from am existing InputStream instance.
Streams will not be closed upon completion.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.yoti.api.client.KeyPairSource
KeyPairSource.StreamVisitor -
Method Summary
Modifier and TypeMethodDescriptionstatic InputStreamKeyPairSourcefromStream(InputStream inputStream) final 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.toString()
-
Method Details
-
fromStream
-
getStream
Return stream held by the source. Expected to return the same instance every time.- Returns:
- stream instance
-
shouldClose
protected boolean shouldClose()Override this to prevent the stream from closing.- Returns:
- true if the stream should not be closed
-
toString
-
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
-