Skip to content

Support for signing PowerShell scripts #13

@aaronesau-summit

Description

@aaronesau-summit

It would be awesome if this project added support for signing PowerShell scripts given the private key and a string that contains the PS. As far as I know, no other cross-platform project supports this right now.

It looks like, to do this, we need to encode the signature (which I don't understand how the sig is generated) in the following way:

def format_binary_sig(contents):
    chunks = lambda x, size = 64 : [x[i:i+size] for i in range(0, len(x), size)]

    contents = base64.b64encode(contents)
    contents = '\n# '.join(chunks(contents.decode('utf-8'), size = 64))

    contents = '\n# SIG # Begin signature block\n# %s\n# SIG # End signature block\n' % contents
    return contents.replace('\n', '\r\n')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions