load
Reads the root certificates behind uri, the content address the Storage Access Framework (the system file picker) gives your app, through the content resolver of context. The stream is opened and closed here; the bytes go to load. Android only.
Call it off the main thread: it reads the whole content. Nothing is fetched from the network: an address that starts with http:// or https:// is answered with TrustAnchorLoadProblem.NOT_A_LOCAL_FILE without being opened, and the app downloads the file itself. Content larger than 16 MiB is answered with TrustAnchorLoadProblem.TOO_LARGE. Never throws: every failure is a typed TrustAnchorLoad.problem.
A content address nobody answers for: TrustAnchorLoadProblem.NOT_FOUND.
A provider that gives no stream, an app with no permission for the address (a refused permission grant), or any other failure to read: TrustAnchorLoadProblem.NOT_READABLE.
Since
1.0.0
Parameters
Any context of the app.
The content address of the file the person picked.
Roots the app already holds, used only for a master list's own checks, as in load on bytes.
As load on a content address, with no held roots.
Reads root certificates from bytes. The content is worked out from the bytes alone, never from a file name. Never throws for bad input: every failure is a typed TrustAnchorLoad.problem.
Return
TrustAnchorLoad with what could be read, what could not, and what the content is.
Reads root certificates from bytes, as load does, and checks a master list's own signature against heldRoots: root certificates the app already holds (for example from an earlier load). With none, that check reports that it did not run (TrustAnchorLoadKind.MASTER_LIST only; other content has no signature to check).
The roots in heldRoots are not added to TrustAnchorLoad.anchors: merge the loads you want to trust with TrustAnchorLoad.plus. Who is to be trusted stays the app's choice.
Return
TrustAnchorLoad with what could be read, what could not, and what the content is.
Since
1.0.0
Parameters
Roots the app already holds, used only for the master list's own checks.
Reads root certificates from bytes. The content is worked out from the bytes alone, never from a file name. Never throws for bad input: every failure is a typed TrustAnchorLoad.problem.
Return
TrustAnchorLoad with what could be read, what could not, and what the content is.
Reads root certificates from bytes, as load does, and checks a master list's own signature against heldRoots: root certificates the app already holds (for example from an earlier load). With none, that check reports that it did not run (TrustAnchorLoadKind.MASTER_LIST only; other content has no signature to check).
The roots in heldRoots are not added to TrustAnchorLoad.anchors: merge the loads you want to trust with TrustAnchorLoad.plus. Who is to be trusted stays the app's choice.
Return
TrustAnchorLoad with what could be read, what could not, and what the content is.
Since
1.0.0
Parameters
Roots the app already holds, used only for the master list's own checks.
Reads the local file at path, so a Swift caller can pass url.path. The SDK never downloads: a string that starts with http:// or https:// is answered with TrustAnchorLoadProblem.NOT_A_LOCAL_FILE and nothing is fetched, and the app downloads the file itself and passes the local path. A file larger than 16 MiB is answered with TrustAnchorLoadProblem.TOO_LARGE before it is read into memory; a real master list is about 1 MB. Never throws.
As load on a path, with heldRoots for a master list's own checks.
Reads root certificates from bytes. The content is worked out from the bytes alone, never from a file name. Never throws for bad input: every failure is a typed TrustAnchorLoad.problem.
Return
TrustAnchorLoad with what could be read, what could not, and what the content is.
Reads root certificates from bytes, as load does, and checks a master list's own signature against heldRoots: root certificates the app already holds (for example from an earlier load). With none, that check reports that it did not run (TrustAnchorLoadKind.MASTER_LIST only; other content has no signature to check).
The roots in heldRoots are not added to TrustAnchorLoad.anchors: merge the loads you want to trust with TrustAnchorLoad.plus. Who is to be trusted stays the app's choice.
Return
TrustAnchorLoad with what could be read, what could not, and what the content is.
Since
1.0.0
Parameters
Roots the app already holds, used only for the master list's own checks.
Reads root certificates from bytes. The content is worked out from the bytes alone, never from a file name. Never throws for bad input: every failure is a typed TrustAnchorLoad.problem.
Return
TrustAnchorLoad with what could be read, what could not, and what the content is.
Reads root certificates from bytes, as load does, and checks a master list's own signature against heldRoots: root certificates the app already holds (for example from an earlier load). With none, that check reports that it did not run (TrustAnchorLoadKind.MASTER_LIST only; other content has no signature to check).
The roots in heldRoots are not added to TrustAnchorLoad.anchors: merge the loads you want to trust with TrustAnchorLoad.plus. Who is to be trusted stays the app's choice.
Return
TrustAnchorLoad with what could be read, what could not, and what the content is.
Since
1.0.0
Parameters
Roots the app already holds, used only for the master list's own checks.