I'm planning to use these XMP Metadata property handlers to store my encryption keys in order for my programs to read it (for security purposes). I've done some on PDF Files and now I'm trying to add an encryption key support for Images and MS Word Files.
I'm using Aspose Imaging
to convert any image to TIFF and add custom metadata to it but it seems that Metadata Extractor
from github https://github.com/drewnoakes/metadata-extractor cannot read what I've imported.
Importing XMP via Aspose Imaging
:
using (TiffImage image = (TiffImage)Aspose.Imaging.Image.Load(imagepath))
{
XmpHeaderPi xmpHeader = new XmpHeaderPi("Company Metadata");
XmpTrailerPi xmpTrailer = new XmpTrailerPi(true);
XmpMeta xmpMeta = new XmpMeta();
xmpMeta.AddAttribute("Company", "Some Company Inc.");
xmpMeta.AddAttribute("EncryptionKey", cryptography.Encrypt(Guid.NewGuid().ToString(),"somekey"));
XmpPacketWrapper xmpData = new XmpPacketWrapper(xmpHeader, xmpTrailer, xmpMeta);
image.XmpData = xmpData;
image.Save();
}
Result from MetadataExtractor
Am I doing the wrong way to import metadata? Or is there any libraries that can read this instead of using Aspose Imaging to read it?