Chilkat Examples

ChilkatHOMEAndroid™Classic ASPCC++C#Mono C#.NET Core C#C# UWP/WinRTDataFlexDelphi ActiveXDelphi DLLVisual FoxProJavaLianjaMFCObjective-CPerlPHP ActiveXPHP ExtensionPowerBuilderPowerShellPureBasicCkPythonChilkat2-PythonRubySQL ServerSwift 2Swift 3,4,5...TclUnicode CUnicode C++Visual Basic 6.0VB.NETVB.NET UWP/WinRTVBScriptXojo PluginNode.jsExcelGo

VB.NET UWP/WinRT Examples

Web API Categories

ASN.1
Amazon EC2
Amazon Glacier
Amazon S3
Amazon S3 (new)
Amazon SES
Amazon SNS
Amazon SQS
Azure Cloud Storage
Azure Service Bus
Azure Table Service
Base64
Bounced Email
Box
CAdES
CSR
CSV
Certificates
Compression
DKIM / DomainKey
DSA
Diffie-Hellman
Digital Signatures
Dropbox
Dynamics CRM
EBICS
ECC
Ed25519
Email Object
Encryption
FTP
FileAccess
Firebase
GMail REST API
GMail SMTP/IMAP/POP
Geolocation
Google APIs
Google Calendar
Google Cloud SQL
Google Cloud Storage
Google Drive
Google Photos
Google Sheets
Google Tasks
Gzip
HTML-to-XML/Text
HTTP

HTTP Misc
IMAP
JSON
JSON Web Encryption (JWE)
JSON Web Signatures (JWS)
JSON Web Token (JWT)
Java KeyStore (JKS)
MHT / HTML Email
MIME
MS Storage Providers
Microsoft Graph
NTLM
OAuth1
OAuth2
OIDC
Office365
OneDrive
OpenSSL
Outlook
Outlook Calendar
Outlook Contact
PDF Signatures
PEM
PFX/P12
PKCS11
POP3
PRNG
REST
REST Misc
RSA
SCP
SCard
SFTP
SMTP
SSH
SSH Key
SSH Tunnel
ScMinidriver
SharePoint
Socket/SSL/TLS
Spider
Stream
Tar Archive
Upload
WebSocket
XAdES
XML
XML Digital Signatures
XMP
Zip
curl

 

 

 

(VB.NET UWP/WinRT) Load SSH Keys Produced by ssh-keygen

Demonstrates how to load the public and private keys produced by ssh-keygen.

Chilkat Universal Windows Platform (UWP) / WinRT Downloads

Chilkat for the Universal Windows Platform (UWP)

' This example assumes the Chilkat API to have been previously unlocked.
' See Global Unlock Sample for sample code.

' We first generate a key like this:

'     ssh-keygen -f stg.chilkat.id
'     Generating public/private rsa key pair.
'     Enter passphrase (empty for no passphrase):
'     Enter same passphrase again:
'     Your identification has been saved in stg.chilkat.id.
'     Your public key has been saved in stg.chilkat.id.pub.
'     The key fingerprint is:
'     SHA256:hkbgexkspxYTa8rYUxouRU8Gi7lbbsT6dSLX+JlStKk me@example02240
'     The key's randomart image is:
'     +---[RSA 2048]----+
'     |  o.=            |
'     | + * =           |
'     |o + X =          |
'     | O * O.+         |
'     |+ @ +.=oS        |
'     | A o =+.         |
'     |o + =oo          |
'     | o +E+ o         |
'     |  .  .+          |
'     +----[SHA256]-----+

' 

' The public key (generated to the file stg.chilkat.id.pub) contains this:
' ssh-rsa AAAAB3NzaC1yc2EAAAADAQABA.. FDt+dKJEkhw8I7LpEi17diB9 me@example02240

' First let's load the public key:
Dim pubkey As New Chilkat.SshKey

Dim success As Boolean = pubkey.FromOpenSshPublicKey(pubkey.LoadText("qa_data/sshKeys/ssh-keygen/stg.chilkat.id.pub"))
If (success = False) Then
    Debug.WriteLine(pubkey.LastErrorText)
    Exit Sub
End If


Debug.WriteLine(pubkey.LastErrorText)
Debug.WriteLine("Successfully loaded the public key.")

' Now try the private key, which contains this:

' -----BEGIN OPENSSH PRIVATE KEY-----
' b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAABFwAAAAdzc2gtcn
' NhAAAAAwEAAQAAAQEArNH9CpKhVgpGbOEDaFH4CaL9iQE6IwVYqKFkcF9qdHc6XA+J9PeR
' 9CMvTtVWm/uCYsoYzRkitNIEokjxFwyQwJeng+qWh5t538Ji3v64ls0mgsdvecyYDYjU8T
' mqhivXk/DzNBUOuyN5ksP0ZmRJLuZ4J6MKCrPugvKsE4zDQkg7/lKUL40ugjpoYJnhRjHv
' uogSkcecq6Kdw20WdRWTFvXiRH8mdh9cVWi3fv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3uuoaIUeZD0vUs+mAv1pz8fbTAD2n37
' Rh57mxDNQIwiD8lV5wZ20NP03nAr8gUQaijsBRy3gDXHX7Qa/BaJ2bY0492HXwVYi9bsng
' GJQinYjmJQQeR/w4u5rNzuD8y1ysMwh/sE8IGu6LLG1IBDYr0AAACBAMord/G9vderFO+1
' tNZHl09m9mFLJTHRVH41Da2uCl2KJnYir511M9GSG9Un6L+UGu4F9CrypehgJHZ6QbwpgS
' JrwlCfE09jPkuH0aktg9fnrrEJYS30wWNNSj1v/91v1F3fdrZePd+UnKcP6zZB3jICzPhW
' elU1OYdWf+qFrnDBAAAAGWRqYWNrc29uMDIyQGRqYWNrc29uMDIyNDAB
' -----END OPENSSH PRIVATE KEY-----

Dim privkey As New Chilkat.SshKey

success = privkey.FromOpenSshPrivateKey(pubkey.LoadText("qa_data/sshKeys/ssh-keygen/stg.chilkat.id"))
If (success = False) Then
    Debug.WriteLine(privkey.LastErrorText)
    Exit Sub
End If


Debug.WriteLine(privkey.LastErrorText)
Debug.WriteLine("Successfully loaded the private key.")

 

© 2000-2022 Chilkat Software, Inc. All Rights Reserved.