<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">2017-09-13 20:59 GMT+02:00 Casimiro de Almeida Barreto <span dir="ltr"><<a href="mailto:casimiro.barreto@gmail.com" target="_blank">casimiro.barreto@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello,<br>
<br>
Perhaps someone can help me with this problem: I'm saving a key pair in a mariadb/mysql table as follows:<br>
<br>
    str := 'INSERT INTO chaves_de_encriptacao (numero_funcional, chave_privada, chave_publica) '.<br>
    str := str,'VALUES ('''.<br>
    str := str, self personId leaId asString, ''', '''.<br>
    str := str, self keyPair privateKey asAsn1DerBytes asByteArray hex, ''', '''.<br>
    str := str, self keyPair publicKey  asAsn1DerBytes asByteArray hex,''')'.<br>
<br>
    [ dbConnection execute: str ] on: Exception do: [ ^ false ].<br>
<br>
And I'd like to recover the keys (SELECT * FROM chaves_de_encriptacao WHERE numero_funcional = 1010) and then reconvert in order to recover the original keys. Obviously I can do that by writting a parser that will get the hex and bring it back to binary but I'd like to avoid it.<br>
<br>
Question is: is there a reverse for asByteArray hex?<br>
<br></blockquote><div>Just browse class side for the most simple snippet:<br><div>    ByteArray fromHexString: #[0 1 3 65 0] hex</div> </div><div>Or are you after something else?<br></div></div><br></div></div>