FAQ
Here are my experiments :
package main

import (
"bytes"
"code.google.com/p/go.crypto/openpgp"
"encoding/base64"
"fmt"
)

func main() {

//openpgp.NewEntity("bussiere", "test", "bussiere@gmail.com", nil)

var entity *openpgp.Entity
entity, err := openpgp.NewEntity("bussiere", "test", "bussiere@gmail.com",
nil)
if err != nil {

}

var (
buffer bytes.Buffer
)

entity.SerializePrivate(&buffer, nil)
data := base64.StdEncoding.EncodeToString([]byte(buffer.String()))

fmt.Printf("%q\n", data)

entity.Serialize(&buffer)
data2 := base64.StdEncoding.EncodeToString([]byte(buffer.String()))

fmt.Printf("%q\n", data2)

//fmt.Printf(buffer.String())
}

Is data just the private key ?
Is data2 the private key AND the public key ?

how to separate the public and private key in data 2 (if it's that ?) ?

How to use the keys after ?

Regards
Bussiere


"Les nouvelles technologies offrent pleins de nouvelles possibilités,
pleins de possibilités d'erreurs surtout en fait."
insurance.aes256 : http://goo.gl/gHyAY
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.2.1 (MingW32) - WinPT 0.7.96rc1

mQGiBE9sjdsRBADsY+DaDgj+pDuGLNVL6Dc+ghCxaEBK+9nwBvKPGIUocz13V42P
5Jn/NJ9zRgZNdg5XbhohN2ltas8Nr09rrRQXbBk8zjCg/Qr0a4LmfA3j128SwCfZ
aTe5zlo/WSSuGv6kWGe/KZrLmiQoZRTDbZzqWyZxuJRkcpgsZc+jYRXJHwCgualT
LpC23Ja3plM6J6noFaqAlMUEAKZGDadSS/BW4gckw9XqSHRex7/XyWU4sqVQlhMy
5DEIba7H8cU6grww+p/cYa3OCocv5Mycf6MbWDCPrtsG0X08u8PgEaE29BsLIgSm
JF6r8y4Rgwj5xyCMTaxql82S+tZHyScpAoQ0a+xlTwxMZMuwK9p6b7oipXHL+UPN
sDfkBACoYLS4PQPFotqWI96j83NNLwEumUzA6Rqyas8w6Xwr51quA65y/0nBmMmp
l58tKN7eyc5+bIpRX5bGG6ktCUHnfzk9uvnG7peilWzYT6+AJ3gbBgMGLBPByJBN
NH+nLjzsh4PzIxuSHLMiK5FkDNE2B95kaahIg42SQPT80LyvDLQlYnVzc2llcmVf
cHJpdmF0ZSA8YnVzc2llcmVAZ21haWwuY29tPohZBBMRAgAZBQJPbI3bBAsHAwID
FQIDAxYCAQIeAQIXgAAKCRAYpzZWoPP7b0h0AJ4n9feBF2FH4JUGhLU3XL3eIrOX
9gCfZbN4JHYl/nRLL4uHrceRUk1M9Pm5Ac0ET2yN3hAHAK5MypLMT50yklt1n/pQ
MjrFXuvM9IQvVyQemHMUBqKqxPTVMJLn86mR5mTLMqs+WVAqei8GTsQeSSvHyIbk
8RvYrKY7aK2RVZUV1dHQ6PII0w3BI5C0L9GM/UyIq0VRXTW6zjp9hS/xgn5SrQad
VIdGQKFVJa9h5/AzgjseARMQRkTQA/xX5/WmHxXaXUPhGxCeFsoqs53UFz1rkHYx
mus2WiD0gHbJ58DiMlVmupeNumi4e9wa+mYuW4qGwjzsQn9ZFNdoiUFzQrqZa6o+
Son+yZpGe/H9VidrWR5LhwD7AAMGBv9bhswvwpQ23X0kGItv7/jHVr/RJui7FAXY
mOM4WAoUv/5ttPHf8OifWmeUDPlzm4txvR5a7t4hhVDehek1J7FEVvfG+ffcHiPP
kkFaUv2EgrXziozt/Vkr2nngsKO5FpRJe9GSqn68uZirhwbkHSKX6LPNFTWSYR3E
fefnsCaP82OJDBFGFMg2aMsz9QL85bg58fgHU972kLTePXUVAh3gaxb6qpjwZt2b
yrCGJ/rnmIc/IWH8TJtHI5Yf3Abx2vlFTtzRH0CwVXuO0msjcfRrrrrS8NSm/ih5
0ssElxKU6IhGBBgRAgAGBQJPbI3eAAoJEBinNlag8/tvoBEAn2Yqu0UFC5OSjD1Y
JQ00FFjNVestAJ0XctcbmhKaFuQ46SccW8C2JDG/xA==
=+VZi
-----END PGP PUBLIC KEY BLOCK-----

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Agl at Mar 12, 2013 at 4:52 pm

    On Tuesday, March 12, 2013 10:05:19 AM UTC-4, bussiere adrien wrote:

    Is data just the private key ?
    No, it's the full Entity, including private key material.

    Is data2 the private key AND the public key ?
    No, just the public part.

    how to separate the public and private key in data 2 (if it's that ?) ?
    An Entity contains several private keys, which can be found inside the
    structure (and are exported). The lower level functions can be used to
    serialize a specific
    subkey: http://godoc.org/code.google.com/p/go.crypto/openpgp/packet#PrivateKey.Serialize

    If the documentation[1] isn't illuminating, then running `gpg
    --list-packets` on armored output may be helpful. That mode of gpg will
    dump debugging information about any OpenPGP input.

    [1] http://godoc.org/code.google.com/p/go.crypto/openpgp


    Cheers

    AGL

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedMar 12, '13 at 2:06p
activeMar 12, '13 at 4:52p
posts2
users2
websitegolang.org

2 users in discussion

Agl: 1 post Bussiere bussiere: 1 post

People

Translate

site design / logo © 2022 Grokbase