Package com.microej.util.appverifier
Class SignedApplicationVerifier
java.lang.Object
com.microej.util.appverifier.SignedApplicationVerifier
Verifies signed Application binaries: it validates the certificate path and verifies the signature of a DER-encoded
signed Application, then exposes the installable Application binary.
- Since:
- 1.0.0
-
Constructor Summary
ConstructorsConstructorDescriptionSignedApplicationVerifier(CertificateChainValidator certificateChainValidator) Constructs aSignedApplicationVerifierwith the givenCertificateChainValidator. -
Method Summary
Modifier and TypeMethodDescriptionverify(InputStream signedApplication) Starts decoding the given DER-encoded signed Application stream and returns its installable binary.
-
Constructor Details
-
SignedApplicationVerifier
Constructs aSignedApplicationVerifierwith the givenCertificateChainValidator.- Parameters:
certificateChainValidator- the given certificate validator.
-
-
Method Details
-
verify
public SignedApplicationBinaryInputStream verify(InputStream signedApplication) throws IOException, InvalidApplicationFormatException Starts decoding the given DER-encoded signed Application stream and returns its installable binary.The certificate chain is validated and the signer authorized before this method returns. The digital signature is verified lazily: it is triggered only once the returned stream has been entirely consumed. Use
SignedApplicationBinaryInputStream.isVerified()after consumption to confirm the signature.- Parameters:
signedApplication- the DER-encoded signed Application stream.- Returns:
- the installable Application binary, positioned on the Application payload.
- Throws:
IOException- if an I/O error occurs, or if the certificate chain is untrusted or unauthorized.InvalidApplicationFormatException- if an error occurs while decoding the signed Application.
-