564
edits
No edit summary |
|||
| Line 59: | Line 59: | ||
== Browser Window property | == Browser Window property WebIDL == | ||
;window.mozCrypto<br> | ;window.mozCrypto<br> | ||
| Line 65: | Line 65: | ||
All windows will have this property (in the current implementation) for the time being as this API is hashed out. | All windows will have this property (in the current implementation) for the time being as this API is hashed out. | ||
The property is namespaced in order to provide future capabilities. | The property is namespaced in order to provide future capabilities.<br> | ||
<pre class="brush:js;toolbar:false;"> | <pre class="brush:js;toolbar:false;"> | ||
{ | [Supplemental] | ||
interface Crypto { | |||
readonly attribute CryptoPk pk; | |||
readonly attribute CryptoSym sym; | |||
readonly attribute CryptoHash hash; | |||
readonly attribute CryptoHmac hmac; | |||
}; | |||
dictionary CryptoKeyPair { | |||
long created; | |||
DOMString privKey; | |||
DOMString pubKey; | |||
DOMString salt; | |||
DOMString iv; | |||
DOMString algorithm; | |||
} | |||
dictionary CryptoConfiguration { | |||
CryptoKeyPair keyID; | |||
}; | |||
interface PKCryptoMessage { | |||
attribute DOMString cryptoMessage; | |||
attribute DOMString wrappedKey; | |||
attribute DOMString pubKey; | |||
attribute DOMString salt; | |||
attribute DOMString iv; | |||
attribute DOMString algorithm; | |||
}; | |||
[Callback=FunctionOnly, NoInterfaceObject] interface GenerateKeypairCallback { | |||
void onsuccess(DOMString pubKey); | |||
}; | |||
[Callback=FunctionOnly, NoInterfaceObject] interface PKEncryptCallback { | |||
void onsuccess(PKCryptoMessage message); | |||
}; | |||
[Callback=FunctionOnly, NoInterfaceObject] interface PKDecryptCallback { | |||
void onsuccess(DOMString plainText); | |||
}; | |||
[Callback=FunctionOnly, NoInterfaceObject] interface PKSignCallback { | |||
void onsuccess(DOMString signature); | |||
}; | |||
[Callback=FunctionOnly, NoInterfaceObject] interface PKVerifyCallback { | |||
void onsuccess(boolean verified); | |||
}; | |||
interface CryptoPk { | |||
attribute DOMString algorithm; | |||
void generateKeypair(GenerateKeypairCallback callback); | |||
void encrypt(DOMString plainText, DOMString pubKey, PKEncryptCallback callback); | |||
void decrypt(PKCryptoMessage message, PKDecryptCallback callback); | |||
void sign(DOMString plainText, PKSignCallback callback); | |||
void verify(DOMString signature, DOMString plainText, PKVerifyCallback callback); | |||
}; | |||
[Callback=FunctionOnly, NoInterfaceObject] interface SymGenerateKeyCallback { | |||
void onsuccess(DOMString symKey); | |||
}; | |||
[Callback=FunctionOnly, NoInterfaceObject] interface SymEncryptCallback { | |||
void onsuccess(DOMString cipherText); | |||
}; | |||
[Callback=FunctionOnly, NoInterfaceObject] interface SymDecryptCallback { | |||
void onsuccess(DOMString plainText); | |||
}; | |||
interface CryptoSym { | |||
attribute DOMString algorithm; | |||
void generateKey(SymGenerateKeyCallback callback); | |||
void encrypt(DOMString plainText, DOMString symKey, SymEncryptCallback callback); | |||
void decrypt(DOMString cipherText, DOMString symKey, SymDecryptCallback callback); | |||
}; | |||
[Callback=FunctionOnly, NoInterfaceObject] interface hashCallback { | |||
void onsuccess(DOMString hash); | |||
}; | |||
interface CryptoHash { | |||
attribute DOMString algorithm; | |||
void createHash(DOMString plainText, hashCallback callback); | |||
}; | |||
[Callback=FunctionOnly, NoInterfaceObject] interface createHMACCallback { | |||
void onsuccess(DOMString hmac); | |||
}; | |||
[Callback=FunctionOnly, NoInterfaceObject] interface verifyHMACCallback { | |||
void onsuccess(boolean verified); | |||
}; | |||
interface CryptoHmac { | |||
attribute DOMString algorithm; | |||
void createHMAC(DOMString plainText, DOMString pubKey, createHMACCallback callback); | |||
void verifyHMAC(DOMString plainText, verifyHMACCallback callback); | |||
}; | |||
</pre> | </pre> | ||
== Notes == | == Notes == | ||
edits