github.com/hashicorp/terraform-plugin-sdk@v1.17.2/internal/lang/funcs/crypto_test.go (about)

     1  package funcs
     2  
     3  import (
     4  	"fmt"
     5  	"testing"
     6  
     7  	"github.com/zclconf/go-cty/cty"
     8  	"golang.org/x/crypto/bcrypt"
     9  )
    10  
    11  func TestUUID(t *testing.T) {
    12  	result, err := UUID()
    13  	if err != nil {
    14  		t.Fatal(err)
    15  	}
    16  
    17  	resultStr := result.AsString()
    18  	if got, want := len(resultStr), 36; got != want {
    19  		t.Errorf("wrong result length %d; want %d", got, want)
    20  	}
    21  }
    22  
    23  func TestUUIDV5(t *testing.T) {
    24  	tests := []struct {
    25  		Namespace cty.Value
    26  		Name      cty.Value
    27  		Want      cty.Value
    28  		Err       bool
    29  	}{
    30  		{
    31  			cty.StringVal("dns"),
    32  			cty.StringVal("tada"),
    33  			cty.StringVal("faa898db-9b9d-5b75-86a9-149e7bb8e3b8"),
    34  			false,
    35  		},
    36  		{
    37  			cty.StringVal("url"),
    38  			cty.StringVal("tada"),
    39  			cty.StringVal("2c1ff6b4-211f-577e-94de-d978b0caa16e"),
    40  			false,
    41  		},
    42  		{
    43  			cty.StringVal("oid"),
    44  			cty.StringVal("tada"),
    45  			cty.StringVal("61eeea26-5176-5288-87fc-232d6ed30d2f"),
    46  			false,
    47  		},
    48  		{
    49  			cty.StringVal("x500"),
    50  			cty.StringVal("tada"),
    51  			cty.StringVal("7e12415e-f7c9-57c3-9e43-52dc9950d264"),
    52  			false,
    53  		},
    54  		{
    55  			cty.StringVal("6ba7b810-9dad-11d1-80b4-00c04fd430c8"),
    56  			cty.StringVal("tada"),
    57  			cty.StringVal("faa898db-9b9d-5b75-86a9-149e7bb8e3b8"),
    58  			false,
    59  		},
    60  		{
    61  			cty.StringVal("tada"),
    62  			cty.StringVal("tada"),
    63  			cty.UnknownVal(cty.String),
    64  			true,
    65  		},
    66  	}
    67  
    68  	for _, test := range tests {
    69  		t.Run(fmt.Sprintf("uuidv5(%#v, %#v)", test.Namespace, test.Name), func(t *testing.T) {
    70  			got, err := UUIDV5(test.Namespace, test.Name)
    71  
    72  			if test.Err {
    73  				if err == nil {
    74  					t.Fatal("succeeded; want error")
    75  				}
    76  				return
    77  			} else if err != nil {
    78  				t.Fatalf("unexpected error: %s", err)
    79  			}
    80  
    81  			if !got.RawEquals(test.Want) {
    82  				t.Errorf("wrong result\ngot:  %#v\nwant: %#v", got, test.Want)
    83  			}
    84  		})
    85  	}
    86  }
    87  
    88  func TestBase64Sha256(t *testing.T) {
    89  	tests := []struct {
    90  		String cty.Value
    91  		Want   cty.Value
    92  		Err    bool
    93  	}{
    94  		{
    95  			cty.StringVal("test"),
    96  			cty.StringVal("n4bQgYhMfWWaL+qgxVrQFaO/TxsrC4Is0V1sFbDwCgg="),
    97  			false,
    98  		},
    99  		// This would differ because we're base64-encoding hex represantiation, not raw bytes.
   100  		// base64encode(sha256("test")) =
   101  		// "OWY4NmQwODE4ODRjN2Q2NTlhMmZlYWEwYzU1YWQwMTVhM2JmNGYxYjJiMGI4MjJjZDE1ZDZjMTViMGYwMGEwOA=="
   102  	}
   103  
   104  	for _, test := range tests {
   105  		t.Run(fmt.Sprintf("base64sha256(%#v)", test.String), func(t *testing.T) {
   106  			got, err := Base64Sha256(test.String)
   107  
   108  			if test.Err {
   109  				if err == nil {
   110  					t.Fatal("succeeded; want error")
   111  				}
   112  				return
   113  			} else if err != nil {
   114  				t.Fatalf("unexpected error: %s", err)
   115  			}
   116  
   117  			if !got.RawEquals(test.Want) {
   118  				t.Errorf("wrong result\ngot:  %#v\nwant: %#v", got, test.Want)
   119  			}
   120  		})
   121  	}
   122  }
   123  
   124  func TestFileBase64Sha256(t *testing.T) {
   125  	tests := []struct {
   126  		Path cty.Value
   127  		Want cty.Value
   128  		Err  bool
   129  	}{
   130  		{
   131  			cty.StringVal("testdata/hello.txt"),
   132  			cty.StringVal("pZGm1Av0IEBKARczz7exkNYsZb8LzaMrV7J32a2fFG4="),
   133  			false,
   134  		},
   135  		{
   136  			cty.StringVal("testdata/icon.png"),
   137  			cty.StringVal("47U1q9IZW093SmAzdC820Skpn8vHPvc8szud/Y3ezpo="),
   138  			false,
   139  		},
   140  		{
   141  			cty.StringVal("testdata/missing"),
   142  			cty.NilVal,
   143  			true, // no file exists
   144  		},
   145  	}
   146  
   147  	fileSHA256 := MakeFileBase64Sha256Func(".")
   148  
   149  	for _, test := range tests {
   150  		t.Run(fmt.Sprintf("filebase64sha256(%#v)", test.Path), func(t *testing.T) {
   151  			got, err := fileSHA256.Call([]cty.Value{test.Path})
   152  
   153  			if test.Err {
   154  				if err == nil {
   155  					t.Fatal("succeeded; want error")
   156  				}
   157  				return
   158  			} else if err != nil {
   159  				t.Fatalf("unexpected error: %s", err)
   160  			}
   161  
   162  			if !got.RawEquals(test.Want) {
   163  				t.Errorf("wrong result\ngot:  %#v\nwant: %#v", got, test.Want)
   164  			}
   165  		})
   166  	}
   167  }
   168  
   169  func TestBase64Sha512(t *testing.T) {
   170  	tests := []struct {
   171  		String cty.Value
   172  		Want   cty.Value
   173  		Err    bool
   174  	}{
   175  		{
   176  			cty.StringVal("test"),
   177  			cty.StringVal("7iaw3Ur350mqGo7jwQrpkj9hiYB3Lkc/iBml1JQODbJ6wYX4oOHV+E+IvIh/1nsUNzLDBMxfqa2Ob1f1ACio/w=="),
   178  			false,
   179  		},
   180  		// This would differ because we're base64-encoding hex represantiation, not raw bytes
   181  		// base64encode(sha512("test")) =
   182  		// "OZWUyNmIwZGQ0YWY3ZTc0OWFhMWE4ZWUzYzEwYWU5OTIzZjYxODk4MDc3MmU0NzNmODgxOWE1ZDQ5NDBlMGRiMjdhYzE4NWY4YTBlMWQ1Zjg0Zjg4YmM4ODdmZDY3YjE0MzczMmMzMDRjYzVmYTlhZDhlNmY1N2Y1MDAyOGE4ZmY="
   183  	}
   184  
   185  	for _, test := range tests {
   186  		t.Run(fmt.Sprintf("base64sha512(%#v)", test.String), func(t *testing.T) {
   187  			got, err := Base64Sha512(test.String)
   188  
   189  			if test.Err {
   190  				if err == nil {
   191  					t.Fatal("succeeded; want error")
   192  				}
   193  				return
   194  			} else if err != nil {
   195  				t.Fatalf("unexpected error: %s", err)
   196  			}
   197  
   198  			if !got.RawEquals(test.Want) {
   199  				t.Errorf("wrong result\ngot:  %#v\nwant: %#v", got, test.Want)
   200  			}
   201  		})
   202  	}
   203  }
   204  
   205  func TestFileBase64Sha512(t *testing.T) {
   206  	tests := []struct {
   207  		Path cty.Value
   208  		Want cty.Value
   209  		Err  bool
   210  	}{
   211  		{
   212  			cty.StringVal("testdata/hello.txt"),
   213  			cty.StringVal("LHT9F+2v2A6ER7DUZ0HuJDt+t03SFJoKsbkkb7MDgvJ+hT2FhXGeDmfL2g2qj1FnEGRhXWRa4nrLFb+xRH9Fmw=="),
   214  			false,
   215  		},
   216  		{
   217  			cty.StringVal("testdata/icon.png"),
   218  			cty.StringVal("wSInO/tKEOaLGCAY2h/7gtLWMpzyLJ0ijFh95JTpYrPzXQYgviAdL9ZgpD9EAte8On+drvhFvjIFsfQUwxbNPQ=="),
   219  			false,
   220  		},
   221  		{
   222  			cty.StringVal("testdata/missing"),
   223  			cty.NilVal,
   224  			true, // no file exists
   225  		},
   226  	}
   227  
   228  	fileSHA512 := MakeFileBase64Sha512Func(".")
   229  
   230  	for _, test := range tests {
   231  		t.Run(fmt.Sprintf("filebase64sha512(%#v)", test.Path), func(t *testing.T) {
   232  			got, err := fileSHA512.Call([]cty.Value{test.Path})
   233  
   234  			if test.Err {
   235  				if err == nil {
   236  					t.Fatal("succeeded; want error")
   237  				}
   238  				return
   239  			} else if err != nil {
   240  				t.Fatalf("unexpected error: %s", err)
   241  			}
   242  
   243  			if !got.RawEquals(test.Want) {
   244  				t.Errorf("wrong result\ngot:  %#v\nwant: %#v", got, test.Want)
   245  			}
   246  		})
   247  	}
   248  }
   249  
   250  func TestBcrypt(t *testing.T) {
   251  	// single variable test
   252  	p, err := Bcrypt(cty.StringVal("test"))
   253  	if err != nil {
   254  		t.Fatalf("err: %s", err)
   255  	}
   256  
   257  	err = bcrypt.CompareHashAndPassword([]byte(p.AsString()), []byte("test"))
   258  	if err != nil {
   259  		t.Fatalf("Error comparing hash and password: %s", err)
   260  	}
   261  
   262  	// testing with two parameters
   263  	p, err = Bcrypt(cty.StringVal("test"), cty.NumberIntVal(5))
   264  	if err != nil {
   265  		t.Fatalf("err: %s", err)
   266  	}
   267  
   268  	err = bcrypt.CompareHashAndPassword([]byte(p.AsString()), []byte("test"))
   269  	if err != nil {
   270  		t.Fatalf("Error comparing hash and password: %s", err)
   271  	}
   272  
   273  	// Negative test for more than two parameters
   274  	_, err = Bcrypt(cty.StringVal("test"), cty.NumberIntVal(10), cty.NumberIntVal(11))
   275  	if err == nil {
   276  		t.Fatal("succeeded; want error")
   277  	}
   278  }
   279  
   280  func TestMd5(t *testing.T) {
   281  	tests := []struct {
   282  		String cty.Value
   283  		Want   cty.Value
   284  		Err    bool
   285  	}{
   286  		{
   287  			cty.StringVal("tada"),
   288  			cty.StringVal("ce47d07243bb6eaf5e1322c81baf9bbf"),
   289  			false,
   290  		},
   291  		{ // Confirm that we're not trimming any whitespaces
   292  			cty.StringVal(" tada "),
   293  			cty.StringVal("aadf191a583e53062de2d02c008141c4"),
   294  			false,
   295  		},
   296  		{ // We accept empty string too
   297  			cty.StringVal(""),
   298  			cty.StringVal("d41d8cd98f00b204e9800998ecf8427e"),
   299  			false,
   300  		},
   301  	}
   302  
   303  	for _, test := range tests {
   304  		t.Run(fmt.Sprintf("md5(%#v)", test.String), func(t *testing.T) {
   305  			got, err := Md5(test.String)
   306  
   307  			if test.Err {
   308  				if err == nil {
   309  					t.Fatal("succeeded; want error")
   310  				}
   311  				return
   312  			} else if err != nil {
   313  				t.Fatalf("unexpected error: %s", err)
   314  			}
   315  
   316  			if !got.RawEquals(test.Want) {
   317  				t.Errorf("wrong result\ngot:  %#v\nwant: %#v", got, test.Want)
   318  			}
   319  		})
   320  	}
   321  }
   322  
   323  func TestFileMD5(t *testing.T) {
   324  	tests := []struct {
   325  		Path cty.Value
   326  		Want cty.Value
   327  		Err  bool
   328  	}{
   329  		{
   330  			cty.StringVal("testdata/hello.txt"),
   331  			cty.StringVal("b10a8db164e0754105b7a99be72e3fe5"),
   332  			false,
   333  		},
   334  		{
   335  			cty.StringVal("testdata/icon.png"),
   336  			cty.StringVal("d7e6c283185a1078c58213beadca98b0"),
   337  			false,
   338  		},
   339  		{
   340  			cty.StringVal("testdata/missing"),
   341  			cty.NilVal,
   342  			true, // no file exists
   343  		},
   344  	}
   345  
   346  	fileMD5 := MakeFileMd5Func(".")
   347  
   348  	for _, test := range tests {
   349  		t.Run(fmt.Sprintf("filemd5(%#v)", test.Path), func(t *testing.T) {
   350  			got, err := fileMD5.Call([]cty.Value{test.Path})
   351  
   352  			if test.Err {
   353  				if err == nil {
   354  					t.Fatal("succeeded; want error")
   355  				}
   356  				return
   357  			} else if err != nil {
   358  				t.Fatalf("unexpected error: %s", err)
   359  			}
   360  
   361  			if !got.RawEquals(test.Want) {
   362  				t.Errorf("wrong result\ngot:  %#v\nwant: %#v", got, test.Want)
   363  			}
   364  		})
   365  	}
   366  }
   367  
   368  func TestRsaDecrypt(t *testing.T) {
   369  	tests := []struct {
   370  		Ciphertext cty.Value
   371  		Privatekey cty.Value
   372  		Want       cty.Value
   373  		Err        bool
   374  	}{
   375  		// Base-64 encoded cipher decrypts correctly
   376  		{
   377  			cty.StringVal(CipherBase64),
   378  			cty.StringVal(PrivateKey),
   379  			cty.StringVal("message"),
   380  			false,
   381  		},
   382  		// Wrong key
   383  		{
   384  			cty.StringVal(CipherBase64),
   385  			cty.StringVal(WrongPrivateKey),
   386  			cty.UnknownVal(cty.String),
   387  			true,
   388  		},
   389  		// Bad key
   390  		{
   391  			cty.StringVal(CipherBase64),
   392  			cty.StringVal("bad key"),
   393  			cty.UnknownVal(cty.String),
   394  			true,
   395  		},
   396  		// Empty key
   397  		{
   398  			cty.StringVal(CipherBase64),
   399  			cty.StringVal(""),
   400  			cty.UnknownVal(cty.String),
   401  			true,
   402  		},
   403  		// Bad cipher
   404  		{
   405  			cty.StringVal("bad cipher"),
   406  			cty.StringVal(PrivateKey),
   407  			cty.UnknownVal(cty.String),
   408  			true,
   409  		},
   410  		// Empty cipher
   411  		{
   412  			cty.StringVal(""),
   413  			cty.StringVal(PrivateKey),
   414  			cty.UnknownVal(cty.String),
   415  			true,
   416  		},
   417  	}
   418  	for _, test := range tests {
   419  		t.Run(fmt.Sprintf("RsaDecrypt(%#v, %#v)", test.Ciphertext, test.Privatekey), func(t *testing.T) {
   420  			got, err := RsaDecrypt(test.Ciphertext, test.Privatekey)
   421  
   422  			if test.Err {
   423  				if err == nil {
   424  					t.Fatal("succeeded; want error")
   425  				}
   426  				return
   427  			} else if err != nil {
   428  				t.Fatalf("unexpected error: %s", err)
   429  			}
   430  
   431  			if !got.RawEquals(test.Want) {
   432  				t.Errorf("wrong result\ngot:  %#v\nwant: %#v", got, test.Want)
   433  			}
   434  		})
   435  	}
   436  }
   437  
   438  func TestSha1(t *testing.T) {
   439  	tests := []struct {
   440  		String cty.Value
   441  		Want   cty.Value
   442  		Err    bool
   443  	}{
   444  		{
   445  			cty.StringVal("test"),
   446  			cty.StringVal("a94a8fe5ccb19ba61c4c0873d391e987982fbbd3"),
   447  			false,
   448  		},
   449  	}
   450  
   451  	for _, test := range tests {
   452  		t.Run(fmt.Sprintf("sha1(%#v)", test.String), func(t *testing.T) {
   453  			got, err := Sha1(test.String)
   454  
   455  			if test.Err {
   456  				if err == nil {
   457  					t.Fatal("succeeded; want error")
   458  				}
   459  				return
   460  			} else if err != nil {
   461  				t.Fatalf("unexpected error: %s", err)
   462  			}
   463  
   464  			if !got.RawEquals(test.Want) {
   465  				t.Errorf("wrong result\ngot:  %#v\nwant: %#v", got, test.Want)
   466  			}
   467  		})
   468  	}
   469  }
   470  
   471  func TestFileSHA1(t *testing.T) {
   472  	tests := []struct {
   473  		Path cty.Value
   474  		Want cty.Value
   475  		Err  bool
   476  	}{
   477  		{
   478  			cty.StringVal("testdata/hello.txt"),
   479  			cty.StringVal("0a4d55a8d778e5022fab701977c5d840bbc486d0"),
   480  			false,
   481  		},
   482  		{
   483  			cty.StringVal("testdata/icon.png"),
   484  			cty.StringVal("2821bcc8379e1bd6f4f31b1e6a1fbb204b4a8be8"),
   485  			false,
   486  		},
   487  		{
   488  			cty.StringVal("testdata/missing"),
   489  			cty.NilVal,
   490  			true, // no file exists
   491  		},
   492  	}
   493  
   494  	fileSHA1 := MakeFileSha1Func(".")
   495  
   496  	for _, test := range tests {
   497  		t.Run(fmt.Sprintf("filesha1(%#v)", test.Path), func(t *testing.T) {
   498  			got, err := fileSHA1.Call([]cty.Value{test.Path})
   499  
   500  			if test.Err {
   501  				if err == nil {
   502  					t.Fatal("succeeded; want error")
   503  				}
   504  				return
   505  			} else if err != nil {
   506  				t.Fatalf("unexpected error: %s", err)
   507  			}
   508  
   509  			if !got.RawEquals(test.Want) {
   510  				t.Errorf("wrong result\ngot:  %#v\nwant: %#v", got, test.Want)
   511  			}
   512  		})
   513  	}
   514  }
   515  
   516  func TestSha256(t *testing.T) {
   517  	tests := []struct {
   518  		String cty.Value
   519  		Want   cty.Value
   520  		Err    bool
   521  	}{
   522  		{
   523  			cty.StringVal("test"),
   524  			cty.StringVal("9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"),
   525  			false,
   526  		},
   527  	}
   528  
   529  	for _, test := range tests {
   530  		t.Run(fmt.Sprintf("sha256(%#v)", test.String), func(t *testing.T) {
   531  			got, err := Sha256(test.String)
   532  
   533  			if test.Err {
   534  				if err == nil {
   535  					t.Fatal("succeeded; want error")
   536  				}
   537  				return
   538  			} else if err != nil {
   539  				t.Fatalf("unexpected error: %s", err)
   540  			}
   541  
   542  			if !got.RawEquals(test.Want) {
   543  				t.Errorf("wrong result\ngot:  %#v\nwant: %#v", got, test.Want)
   544  			}
   545  		})
   546  	}
   547  }
   548  
   549  func TestFileSHA256(t *testing.T) {
   550  	tests := []struct {
   551  		Path cty.Value
   552  		Want cty.Value
   553  		Err  bool
   554  	}{
   555  		{
   556  			cty.StringVal("testdata/hello.txt"),
   557  			cty.StringVal("a591a6d40bf420404a011733cfb7b190d62c65bf0bcda32b57b277d9ad9f146e"),
   558  			false,
   559  		},
   560  		{
   561  			cty.StringVal("testdata/icon.png"),
   562  			cty.StringVal("e3b535abd2195b4f774a6033742f36d129299fcbc73ef73cb33b9dfd8ddece9a"),
   563  			false,
   564  		},
   565  		{
   566  			cty.StringVal("testdata/missing"),
   567  			cty.NilVal,
   568  			true, // no file exists
   569  		},
   570  	}
   571  
   572  	fileSHA256 := MakeFileSha256Func(".")
   573  
   574  	for _, test := range tests {
   575  		t.Run(fmt.Sprintf("filesha256(%#v)", test.Path), func(t *testing.T) {
   576  			got, err := fileSHA256.Call([]cty.Value{test.Path})
   577  
   578  			if test.Err {
   579  				if err == nil {
   580  					t.Fatal("succeeded; want error")
   581  				}
   582  				return
   583  			} else if err != nil {
   584  				t.Fatalf("unexpected error: %s", err)
   585  			}
   586  
   587  			if !got.RawEquals(test.Want) {
   588  				t.Errorf("wrong result\ngot:  %#v\nwant: %#v", got, test.Want)
   589  			}
   590  		})
   591  	}
   592  }
   593  
   594  func TestSha512(t *testing.T) {
   595  	tests := []struct {
   596  		String cty.Value
   597  		Want   cty.Value
   598  		Err    bool
   599  	}{
   600  		{
   601  			cty.StringVal("test"),
   602  			cty.StringVal("ee26b0dd4af7e749aa1a8ee3c10ae9923f618980772e473f8819a5d4940e0db27ac185f8a0e1d5f84f88bc887fd67b143732c304cc5fa9ad8e6f57f50028a8ff"),
   603  			false,
   604  		},
   605  	}
   606  
   607  	for _, test := range tests {
   608  		t.Run(fmt.Sprintf("sha512(%#v)", test.String), func(t *testing.T) {
   609  			got, err := Sha512(test.String)
   610  
   611  			if test.Err {
   612  				if err == nil {
   613  					t.Fatal("succeeded; want error")
   614  				}
   615  				return
   616  			} else if err != nil {
   617  				t.Fatalf("unexpected error: %s", err)
   618  			}
   619  
   620  			if !got.RawEquals(test.Want) {
   621  				t.Errorf("wrong result\ngot:  %#v\nwant: %#v", got, test.Want)
   622  			}
   623  		})
   624  	}
   625  }
   626  
   627  func TestFileSHA512(t *testing.T) {
   628  	tests := []struct {
   629  		Path cty.Value
   630  		Want cty.Value
   631  		Err  bool
   632  	}{
   633  		{
   634  			cty.StringVal("testdata/hello.txt"),
   635  			cty.StringVal("2c74fd17edafd80e8447b0d46741ee243b7eb74dd2149a0ab1b9246fb30382f27e853d8585719e0e67cbda0daa8f51671064615d645ae27acb15bfb1447f459b"),
   636  			false,
   637  		},
   638  		{
   639  			cty.StringVal("testdata/icon.png"),
   640  			cty.StringVal("c122273bfb4a10e68b182018da1ffb82d2d6329cf22c9d228c587de494e962b3f35d0620be201d2fd660a43f4402d7bc3a7f9daef845be3205b1f414c316cd3d"),
   641  			false,
   642  		},
   643  		{
   644  			cty.StringVal("testdata/missing"),
   645  			cty.NilVal,
   646  			true, // no file exists
   647  		},
   648  	}
   649  
   650  	fileSHA512 := MakeFileSha512Func(".")
   651  
   652  	for _, test := range tests {
   653  		t.Run(fmt.Sprintf("filesha512(%#v)", test.Path), func(t *testing.T) {
   654  			got, err := fileSHA512.Call([]cty.Value{test.Path})
   655  
   656  			if test.Err {
   657  				if err == nil {
   658  					t.Fatal("succeeded; want error")
   659  				}
   660  				return
   661  			} else if err != nil {
   662  				t.Fatalf("unexpected error: %s", err)
   663  			}
   664  
   665  			if !got.RawEquals(test.Want) {
   666  				t.Errorf("wrong result\ngot:  %#v\nwant: %#v", got, test.Want)
   667  			}
   668  		})
   669  	}
   670  }
   671  
   672  const (
   673  	CipherBase64 = "eczGaDhXDbOFRZGhjx2etVzWbRqWDlmq0bvNt284JHVbwCgObiuyX9uV0LSAMY707IEgMkExJqXmsB4OWKxvB7epRB9G/3+F+pcrQpODlDuL9oDUAsa65zEpYF0Wbn7Oh7nrMQncyUPpyr9WUlALl0gRWytOA23S+y5joa4M34KFpawFgoqTu/2EEH4Xl1zo+0fy73fEto+nfkUY+meuyGZ1nUx/+DljP7ZqxHBFSlLODmtuTMdswUbHbXbWneW51D7Jm7xB8nSdiA2JQNK5+Sg5x8aNfgvFTt/m2w2+qpsyFa5Wjeu6fZmXSl840CA07aXbk9vN4I81WmJyblD/ZA=="
   674  	PrivateKey   = `
   675  -----BEGIN RSA PRIVATE KEY-----
   676  MIIEowIBAAKCAQEAgUElV5mwqkloIrM8ZNZ72gSCcnSJt7+/Usa5G+D15YQUAdf9
   677  c1zEekTfHgDP+04nw/uFNFaE5v1RbHaPxhZYVg5ZErNCa/hzn+x10xzcepeS3KPV
   678  Xcxae4MR0BEegvqZqJzN9loXsNL/c3H/B+2Gle3hTxjlWFb3F5qLgR+4Mf4ruhER
   679  1v6eHQa/nchi03MBpT4UeJ7MrL92hTJYLdpSyCqmr8yjxkKJDVC2uRrr+sTSxfh7
   680  r6v24u/vp/QTmBIAlNPgadVAZw17iNNb7vjV7Gwl/5gHXonCUKURaV++dBNLrHIZ
   681  pqcAM8wHRph8mD1EfL9hsz77pHewxolBATV+7QIDAQABAoIBAC1rK+kFW3vrAYm3
   682  +8/fQnQQw5nec4o6+crng6JVQXLeH32qXShNf8kLLG/Jj0vaYcTPPDZw9JCKkTMQ
   683  0mKj9XR/5DLbBMsV6eNXXuvJJ3x4iKW5eD9WkLD4FKlNarBRyO7j8sfPTqXW7uat
   684  NxWdFH7YsSRvNh/9pyQHLWA5OituidMrYbc3EUx8B1GPNyJ9W8Q8znNYLfwYOjU4
   685  Wv1SLE6qGQQH9Q0WzA2WUf8jklCYyMYTIywAjGb8kbAJlKhmj2t2Igjmqtwt1PYc
   686  pGlqbtQBDUiWXt5S4YX/1maIQ/49yeNUajjpbJiH3DbhJbHwFTzP3pZ9P9GHOzlG
   687  kYR+wSECgYEAw/Xida8kSv8n86V3qSY/I+fYQ5V+jDtXIE+JhRnS8xzbOzz3v0WS
   688  Oo5H+o4nJx5eL3Ghb3Gcm0Jn46dHrxinHbm+3RjXv/X6tlbxIYjRSQfHOTSMCTvd
   689  qcliF5vC6RCLXuc7R+IWR1Ky6eDEZGtrvt3DyeYABsp9fRUFR/6NluUCgYEAqNsw
   690  1aSl7WJa27F0DoJdlU9LWerpXcazlJcIdOz/S9QDmSK3RDQTdqfTxRmrxiYI9LEs
   691  mkOkvzlnnOBMpnZ3ZOU5qIRfprecRIi37KDAOHWGnlC0EWGgl46YLb7/jXiWf0AG
   692  Y+DfJJNd9i6TbIDWu8254/erAS6bKMhW/3q7f2kCgYAZ7Id/BiKJAWRpqTRBXlvw
   693  BhXoKvjI2HjYP21z/EyZ+PFPzur/lNaZhIUlMnUfibbwE9pFggQzzf8scM7c7Sf+
   694  mLoVSdoQ/Rujz7CqvQzi2nKSsM7t0curUIb3lJWee5/UeEaxZcmIufoNUrzohAWH
   695  BJOIPDM4ssUTLRq7wYM9uQKBgHCBau5OP8gE6mjKuXsZXWUoahpFLKwwwmJUp2vQ
   696  pOFPJ/6WZOlqkTVT6QPAcPUbTohKrF80hsZqZyDdSfT3peFx4ZLocBrS56m6NmHR
   697  UYHMvJ8rQm76T1fryHVidz85g3zRmfBeWg8yqT5oFg4LYgfLsPm1gRjOhs8LfPvI
   698  OLlRAoGBAIZ5Uv4Z3s8O7WKXXUe/lq6j7vfiVkR1NW/Z/WLKXZpnmvJ7FgxN4e56
   699  RXT7GwNQHIY8eDjDnsHxzrxd+raOxOZeKcMHj3XyjCX3NHfTscnsBPAGYpY/Wxzh
   700  T8UYnFu6RzkixElTf2rseEav7rkdKkI3LAeIZy7B0HulKKsmqVQ7
   701  -----END RSA PRIVATE KEY-----
   702  `
   703  	WrongPrivateKey = `
   704  -----BEGIN RSA PRIVATE KEY-----
   705  MIIEowIBAAKCAQEAlrCgnEVgmNKCq7KPc+zUU5IrxPu1ClMNJS7RTsTPEkbwe5SB
   706  p+6V6WtCbD/X/lDRRGbOENChh1Phulb7lViqgrdpHydgsrKoS5ah3DfSIxLFLE00
   707  9Yo4TCYwgw6+s59j16ZAFVinaQ9l6Kmrb2ll136hMrz8QKh+qw+onOLd38WFgm+W
   708  ZtUqSXf2LANzfzzy4OWFNyFqKaCAolSkPdTS9Nz+svtScvp002DQp8OdP1AgPO+l
   709  o5N3M38Fftapwg0pCtJ5Zq0NRWIXEonXiTEMA6zy3gEZVOmDxoIFUWnmrqlMJLFy
   710  5S6LDrHSdqJhCxDK6WRZj43X9j8spktk3eGhMwIDAQABAoIBAAem8ID/BOi9x+Tw
   711  LFi2rhGQWqimH4tmrEQ3HGnjlKBY+d1MrUjZ1MMFr1nP5CgF8pqGnfA8p/c3Sz8r
   712  K5tp5T6+EZiDZ2WrrOApxg5ox0MAsQKO6SGO40z6o3wEQ6rbbTaGOrraxaWQIpyu
   713  AQanU4Sd6ZGqByVBaS1GnklZO+shCHqw73b7g1cpLEmFzcYnKHYHlUUIsstMe8E1
   714  BaCY0CH7JbWBjcbiTnBVwIRZuu+EjGiQuhTilYL2OWqoMVg1WU0L2IFpR8lkf/2W
   715  SBx5J6xhwbBGASOpM+qidiN580GdPzGhWYSqKGroHEzBm6xPSmV1tadNA26WFG4p
   716  pthLiAECgYEA5BsPRpNYJAQLu5B0N7mj9eEp0HABVEgL/MpwiImjaKdAwp78HM64
   717  IuPvJxs7r+xESiIz4JyjR8zrQjYOCKJsARYkmNlEuAz0SkHabCw1BdEBwUhjUGVB
   718  efoERK6GxfAoNqmSDwsOvHFOtsmDIlbHmg7G2rUxNVpeou415BSB0B8CgYEAqR4J
   719  YHKk2Ibr9rU+rBU33TcdTGw0aAkFNAVeqM9j0haWuFXmV3RArgoy09lH+2Ha6z/g
   720  fTX2xSDAWV7QUlLOlBRIhurPAo2jO2yCrGHPZcWiugstrR2hTTInigaSnCmK3i7F
   721  6sYmL3S7K01IcVNxSlWvGijtClT92Cl2WUCTfG0CgYAiEjyk4QtQTd5mxLvnOu5X
   722  oqs5PBGmwiAwQRiv/EcRMbJFn7Oupd3xMDSflbzDmTnWDOfMy/jDl8MoH6TW+1PA
   723  kcsjnYhbKWwvz0hN0giVdtOZSDO1ZXpzOrn6fEsbM7T9/TQY1SD9WrtUKCNTNL0Z
   724  sM1ZC6lu+7GZCpW4HKwLJwKBgQCRT0yxQXBg1/UxwuO5ynV4rx2Oh76z0WRWIXMH
   725  S0MyxdP1SWGkrS/SGtM3cg/GcHtA/V6vV0nUcWK0p6IJyjrTw2XZ/zGluPuTWJYi
   726  9dvVT26Vunshrz7kbH7KuwEICy3V4IyQQHeY+QzFlR70uMS0IVFWAepCoWqHbIDT
   727  CYhwNQKBgGPcLXmjpGtkZvggl0aZr9LsvCTckllSCFSI861kivL/rijdNoCHGxZv
   728  dfDkLTLcz9Gk41rD9Gxn/3sqodnTAc3Z2PxFnzg1Q/u3+x6YAgBwI/g/jE2xutGW
   729  H7CurtMwALQ/n/6LUKFmjRZjqbKX9SO2QSaC3grd6sY9Tu+bZjLe
   730  -----END RSA PRIVATE KEY-----
   731  `
   732  )