Skip to content

Commit

Permalink
feat(tgteset): export NewPrivateKey
Browse files Browse the repository at this point in the history
  • Loading branch information
ernado committed Aug 10, 2022
1 parent a375981 commit 55a1e45
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tgtest/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package tgtest

import (
"context"
"crypto/rsa"
"io"
"net"
"time"
Expand Down Expand Up @@ -49,6 +50,13 @@ type Server struct {
log *zap.Logger // immutable
}

// NewPrivateKey creates new private key from RSA private key.
func NewPrivateKey(k *rsa.PrivateKey) exchange.PrivateKey {
return exchange.PrivateKey{
RSA: k,
}
}

// NewServer creates new Server.
func NewServer(key exchange.PrivateKey, handler Handler, opts ServerOptions) *Server {
opts.setDefaults()
Expand Down

0 comments on commit 55a1e45

Please sign in to comment.