Created
June 3, 2020 18:47
-
-
Save wibisono/b334fd1c561ea79df05f348d350efbb5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/amm | |
//Install ammonite.io and run amm checkmft.scala or if you +x you can run it as script. | |
import $ivy.`net.ripe.rpki:rpki-commons:1.8.0` | |
import net.ripe.rpki.commons.crypto.cms.manifest.ManifestCmsParser | |
import java.nio.file.{Files, Paths} | |
@main def main(ar: String*){ | |
val args = ar.toArray | |
if(args.length < 1 || !args(0).endsWith("mft")){ | |
println("Mft file name needed") | |
System.exit(0) | |
} | |
val mftFile = args(0) | |
val rp = new ManifestCmsParser() | |
val mft = Files.readAllBytes(Paths.get(mftFile)) | |
rp.parse(mftFile, mft) | |
val mftcms = rp.getManifestCms | |
mftcms.getFileNames.forEach(println) | |
println("Next update time" + mftcms.getNextUpdateTime) | |
println("Not valid before " + mftcms.getNotValidBefore) | |
println("Not valid before " + mftcms.getNotValidAfter) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment