由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - 怎样吧byte[]变成java.security.Key?
相关主题
怎麼得到字符串中的raw bytes?help about bitstream writer
问个很简单的问题?How to parse the bytes[]
How to know the size of a java object ?java servlet question
how to calculate binary in java?Core Java2 Notes (6)
how to multicast objects to clients in java?[转载] Actually let me rephrase my question
请问一个serialize class object下载运行的问题help! BufferedImage
这段实例化的代码可以优化提速吗?问高手:数字签名
Object stream & serilization有啥用处?How to know the size of a file in a prog
相关话题的讨论汇总
话题: key话题: byte话题: bytes话题: api话题: somewhere
进入Java版参与讨论
1 (共1页)
m****r
发帖数: 6639
1
i get the binary bytes from somewhere, that is the key i am suppose to use
when i sign my document.
the api for javax.xml.crypto.dom.DOMCryptoContext wants a java.security.Key
object, not byte[]. but just looking at the api's, it's not clear to me how
i can go from one thing to the other. anyone can help?
thanks
g*****g
发帖数: 34805
2
http://java.sun.com/docs/books/tutorial/security/apisign/vstep2.html
private key is similar. However, private key is supposed to be kept
in keystore though.

Key
how

【在 m****r 的大作中提到】
: i get the binary bytes from somewhere, that is the key i am suppose to use
: when i sign my document.
: the api for javax.xml.crypto.dom.DOMCryptoContext wants a java.security.Key
: object, not byte[]. but just looking at the api's, it's not clear to me how
: i can go from one thing to the other. anyone can help?
: thanks

m******t
发帖数: 2416
3

You need to ask that "somewhere" how to convert these bytes into a key. They
can be anything for all we know - exported ascii, raw bytes of a keystore
file, a serialized Key object, etc.

【在 m****r 的大作中提到】
: i get the binary bytes from somewhere, that is the key i am suppose to use
: when i sign my document.
: the api for javax.xml.crypto.dom.DOMCryptoContext wants a java.security.Key
: object, not byte[]. but just looking at the api's, it's not clear to me how
: i can go from one thing to the other. anyone can help?
: thanks

m****r
发帖数: 6639
4
后来好像是这样解决的. 我自己implement一个MyKey class, 然后, 写 getEncoded().

They

【在 m******t 的大作中提到】
:
: You need to ask that "somewhere" how to convert these bytes into a key. They
: can be anything for all we know - exported ascii, raw bytes of a keystore
: file, a serialized Key object, etc.

1 (共1页)
进入Java版参与讨论
相关主题
How to know the size of a file in a proghow to multicast objects to clients in java?
一个socket相关的问题请问一个serialize class object下载运行的问题
How to compute round-trip time to webser这段实例化的代码可以优化提速吗?
socket and simple web browserObject stream & serilization有啥用处?
怎麼得到字符串中的raw bytes?help about bitstream writer
问个很简单的问题?How to parse the bytes[]
How to know the size of a java object ?java servlet question
how to calculate binary in java?Core Java2 Notes (6)
相关话题的讨论汇总
话题: key话题: byte话题: bytes话题: api话题: somewhere