Package com.microej.util.appverifier
Class SignedApplicationVerifier
- java.lang.Object
-
- com.microej.util.appverifier.SignedApplicationVerifier
-
public class SignedApplicationVerifier extends Object
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
Constructors Constructor Description SignedApplicationVerifier(CertificateChainValidator certificateChainValidator)Constructs aSignedApplicationVerifierwith the givenCertificateChainValidator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SignedApplicationBinaryInputStreamverify(InputStream signedApplication)Starts decoding the given DER-encoded signed Application stream and returns its installable binary.
-
-
-
Constructor Detail
-
SignedApplicationVerifier
public SignedApplicationVerifier(CertificateChainValidator certificateChainValidator)
Constructs aSignedApplicationVerifierwith the givenCertificateChainValidator.- Parameters:
certificateChainValidator- the given certificate validator.
-
-
Method Detail
-
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.
-
-