rdpsign

package module
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 31, 2025 License: Apache-2.0 Imports: 20 Imported by: 0

README

rdpsign

This module implements RDP signing based on the implementation here: https://gitee.com/cyberkylin/rdpsign

There were some minor changes to error handling and the signing process was changed into a module, but all the major functionality is unchanged.

Usage

package main

import (
    "fmt"
    "os"

    "github.com/andrewheberle/rdpsign"
)

func main() {
    signer, err := rdpsign.NewSigner("/path/to/cert", "/path/to/key")
    if err != nil {
        fmt.Printf("Error: %s", err)
        os.Exit(1)
    }

    rdpContent := "contents of\nyour rdp\nfile are here\n"

    signedRdpContent, err := signer.SignRdp(rdpContent)
    if err != nil {
        fmt.Printf("Error: %s", err)
        os.Exit(1)
    }

    fmt.Println(string(signedRdpContent))
}

The major functionality for this module came from https://gitee.com/cyberkylin/rdpsign and all relevant copyrights are still in place.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlgorithmIdentifier

type AlgorithmIdentifier struct {
	ID asn1.ObjectIdentifier
}

type IssuerAndSerialNumber

type IssuerAndSerialNumber struct {
	Issuer       asn1.RawValue
	SerialNumber *big.Int
}

type SignedData

type SignedData struct {
	Version          version
	DigestAlgorithms digestAlgorithmIdentifiers `asn1:"set"`
	ContentInfo      contentInfo                //data oid: 1.2.840.113549.1.7.1
	Certificate      asn1.RawValue              `asn1:"optional,explicit,tag:0"`
	SignerInfos      signerInfos                `asn1:"set"`
}

why the field Certificate is not Certificates(set) ? process Certificate in functions Ignore crls(CertificateRevocationLists), hsh 2017.11.15

type SignedDataObject

type SignedDataObject struct {
	ID         asn1.ObjectIdentifier //signedData oid: 1.2.840.113549.1.7.2
	SignedData SignedData            `asn1:"explicit,tag:0"`
}

type Signer

type Signer struct {
	// contains filtered or unexported fields
}

func New added in v1.1.0

func New(cert, key string, opts ...SignerOption) (*Signer, error)

func (*Signer) Sign added in v1.1.0

func (s *Signer) Sign(content string) ([]byte, error)

type SignerOption added in v1.1.0

type SignerOption func(*Signer)

func WithFs added in v1.1.0

func WithFs(fs afero.Fs) SignerOption

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL