Showing posts from August, 2018

Converting Certificates using OpenSSL

Certificates are an integral part of every IT infrastructure and service since they can be used to encrypt data, secure the communications, verify identities and provide trust. In this article I'm going to demonstrate a number of conversions you may have to perform in order to prepare a certificate to be imported to a system. Before moving on to the actual part about the conversion, a few words about the certificates and their file extensions. Encodings There are two different kinds of encoding for an X509 certificate, DER and PEM. DER encoded files are binary in contrast to PEM which are Base64 encoded and human readable. File Extensions The most commonly used file extensions for certificate and key files are: .crt - Used for certificates in DER or PEM format. .cer - Also used for certificates, alternative to crt .key - Used for private key files .pfx - Used for certificate and private key bundles. Used different format from the others (pkcs12) Conversion When it co

PowerShell Custom Object Formatting

On this article I'm going to touch a field of PowerShell development that most are not aware of. That is formatting. Every PowerShell user has used the "Format-Table" and "Format-List" cmdlets or even the "Format-Custom" to display data in a manner that suits them. What happens though when you have objects that you'll like to format a bit differently or set the default view for? Then its time to use formatting. To start off, we're going to create a custom module. Pick a name for the module - mine is going to be "TestModule" - and create a directory with that name. Then create the module manifest using the "New-ModuleManifest" cmdlet and a script file with the ".psm1" extension. You should end up with a structure like the following: PS C:\> New-Item -ItemType dir -Name TestModule     Directory: C:\Users\cpolydorou\Desktop Mode        LastWriteTime  Length Name ----        -------------  ------ ---- d--