fix NPE & check fo null in StreamProviderRegistration
+ signAndEncrypt in StreamBasicRegistration